Created
August 2, 2017 02:40
-
-
Save mohapsat/fe61cd1c1d50b6ac46508bdd4a448b82 to your computer and use it in GitHub Desktop.
To revert to a commit further back than the most recent commit
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
# To revert to a commit further back than the most recent commit | |
-------- | |
git reset 56e05fced #resets index to former commit; replace '56e05fced' with your commit code | |
git reset --soft HEAD@{1} #moves pointer back to previous HEAD | |
git commit -m "Revert to 56e05fced" | |
git reset --hard #updates working copy to reflect the new commit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment