dideler / dotfiles

:page_facing_up: These are my dotfiles. There are many like them, but these are mine.
MIT License
25 stars 4 forks source link

Add git alias to undo amend #14

Open dideler opened 10 years ago

dideler commented 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

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.