Open dideler opened 10 years ago
http://stackoverflow.com/questions/1459150/how-to-undo-git-commit-amend-done-instead-of-git-commit
Immediately after an amend, git reflog should show something like
git reflog
f41210d HEAD@{0}: commit (amend): Summary line Z 9a0c170 HEAD@{1}: commit: Summary line Z 07dd8f6 HEAD@{2}: commit: Summary line X ...
If the first line contains "commit (amend)", grab the associated checksum hash and use it to undo the commit with git reset --soft.
git reset --soft
http://stackoverflow.com/questions/1459150/how-to-undo-git-commit-amend-done-instead-of-git-commit
Immediately after an amend,
git reflog
should show something likeIf the first line contains "commit (amend)", grab the associated checksum hash and use it to undo the commit with
git reset --soft
.