To answer your question, you can try to do a commit and then redo as displayed below for your reference:-
$ git commit -m "Something terribly misguided" # (0: Your Accident)
$ git reset HEAD~ # (1)
[ edit files as necessary ] # (2)
$ git add . # (3)
$ git commit -c ORIG_HEAD # (4)
The above line of code is going to help you with the undo part which will undo the last commit of yours which will also leave the state of your disk and files non touched. You will have to add them once more prior to committing them again. Follow this by making various corrections to the working tree files and then git add anything according to what you want to add to your fresh commit. By reusing your old commit message, commit the changes required and reset copied the old head to .git/ORIG_HEAD; commit with -c ORIG_HEAD. Priorily, this will include the message log from the previous commit and will ensure access for you to edit if required. The -C option can be used if thought otherwise. To ensure editorial actions for the previous commit, use this:- commit --amend which will update the changes within the current index all the way to the previous commit. Finally, in order to remove a commit which has been sent to the server, the rewriting of the history with the git push origin master --force is necessary.