Flip Flip - 9 days ago 5
Git Question

How to abort 'git commit --amend'?

I accidentally used

git commit --amend
. My text editor is open and waits for input. I know, that when I close it now (not changing the existing commit message, the commit will be amended. What can I do to abort the process?

In this blog it says that I can simply delete the commit message and the commit will then not be valid and ignored. Is that correct? Are there alternatives?

djb djb
Answer

That is correct. Saving the file with no contents will abort the amend.