git discard local changes
# Discarding local changes (permanently) to a file:
git checkout -- <file>
# Discard all local changes to all files permanently:
git reset --hard
git discard local changes
# Discarding local changes (permanently) to a file:
git checkout -- <file>
# Discard all local changes to all files permanently:
git reset --hard
git reset change in one file
# undo local changes to specific file
git checkout -- file
how to undo a modified file in git
# If you want to revert the changes only in current working directory
git checkout -- .
# discard anything (note: you have to be in the directory
# where all of the changes are located)
# or you can use the command on line 9, you can discard anything
# on the repo
git checkout -- *
git checkout -- :/
# or if you check the git status message after modifying a file
# there is this command
git restore <file>
undo unstaged changes git
git checkout -- .
git file reset to head
git checkout HEAD -- my-file.txt
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us