Last Updated: September 09, 2019
· erdk

Git: correct commit

Bad commit? Too fast?
Add, modify, remove what you must (git add/rm etc.) and then:
$ git commit --amend
This open commit window with last commit message, but when you commit now it will include your later changes.

2 Responses
Add your response

You forgot to mention that the correction must be made before pushing to the repo.

over 1 year ago ·

If you wish to amend and keep the same message and author as before (and skip editing), you can use -C.

git commit --amend -C
over 1 year ago ·