Created
December 17, 2012 08:02
-
-
Save TheRatG/4316534 to your computer and use it in GitHub Desktop.
git revert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Try this first: | |
git checkout master | |
(If you're on a different branch than master, use the branch name there instead.) | |
If that doesn't work, try... | |
For a single file: | |
git checkout HEAD /path/to/file | |
For the entire repository working copy: | |
git reset --hard HEAD | |
And if that doesn't work, then you can look in the reflog to find your old head SHA and reset to that: | |
git reflog | |
git reset --hard <sha from reflog> | |
HEAD is a name that always points to the latest commit in your current branch. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment