Created
November 25, 2015 00:46
-
-
Save smurugap/a77c454b72cae21c1df4 to your computer and use it in GitHub Desktop.
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
Accidental git amend on top of the Head | |
# Move the current head so that it's pointing at the old commit | |
# Leave the index intact for redoing the commit | |
git reset --soft HEAD@{1} | |
# commit the current tree using the commit details of the previous | |
# HEAD commit. (Note that HEAD@{1} is pointing somewhere different from the | |
# previous command. It's now pointing at the erroneously amended commit.) | |
git commit -C HEAD@{1} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment