Created
September 4, 2013 18:57
-
-
Save jaunesarmiento/6441264 to your computer and use it in GitHub Desktop.
Step-by-step process to revert to a previous commit using its SHA hash
This file contains 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
# reset the index to the desired tree | |
git reset 56e05fced | |
# move the branch pointer back to the previous HEAD | |
git reset --soft HEAD@{1} | |
git commit -m "Revert to 56e05fced" | |
# Update working copy to reflect the new commit | |
git reset --hard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment