How to abort a git commit amend

29 Apr tutorialhorizon.com
"Sometimes you issue a `git commit --amend` only to realize that you didn't really mean to amend the previous commit."
In vi: `ESC :cq!` (quit without saving and report an error). In anything else: Delete the commit message, so git will complain about the missing message instead of continuing.

1 comment

mansr 30 Apr
@interesting And if you realise the mistake after making the commit: git reset HEAD@{1}