From `man git-commit`:
FILES
$GIT_DIR/COMMIT_EDITMSG
This file contains the commit message of a commit in progress. If git commit exits due to an error before creating a commit, any commit message that has been provided
by the user (e.g., in an editor session) will be available in this file, but will be overwritten by the next invocation of git commit.
So, rather than repeat `git commit`, to retry with the previous message one can use:
$ git commit -m "$(cat .git/COMMIT_EDITMSG)"
Or in general (suitable for an alias for example):
$ git commit -m "$(cat "$(git rev-parse --git-dir)/COMMIT_EDITMSG)")"