When editing a comment, you can save the contents of the editor in a file somewhere, say message.txt. If for some reason the commit failed, you can reuse the file as follows:
git commit -F message.txt
If you did not save the message before exiting the editor, and the commit failed, it disappeared forever.
Btw, note that the commit message editor contains the following:
If you included this text in the message file that you saved, and then you use this file later with -For flags --file, then these lines will be included in the commit message. Therefore, you will want to clean them or not save them first.
UPDATE
, , .git/COMMIT_EDITMSG, . :
git commit -eF .git/COMMIT_EDITMSG