Revert to the last commit change:
git checkout --+ file name to recover from
However, it is important to note that if the file is already add to the staging queue, the above command will not be an inspiration.
This file needs to be canceled before staging:
git reset HEAD --+ Need to cancel the staged file name
Then use the first command.
If you feel the command is too much to remember, then do one or two anonymous chant, such as:
git config --global alias.unstage ‘reset HEAD --‘
git config --global alias. restore ' checkout--'
We take readme.md This file example, such as modified a text description, want to revert back to the original appearance:
git restore README.md
OK, if the modifications have been git add Readme. md put it in the staging queue, it's going to
git unstage README.md
git restore README.md
Git recovers files that have been modified