Flip Flip - 1 year ago 99
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download