git reset change in one file
# undo local changes to specific file
git checkout -- file
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>
discard unstaged changes git
#For all unstaged files in current working directory use:
git checkout -- .
#For a specific file use:
git checkout -- path/to/file/to/revert
git discard unstaged files
git stash save --keep-index --include-untracked
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