git-amend pushed commit - How to modify existing, unpushed commit messages?

git amend specific commit / git / git-commit / git-rewrite-history / git-amend

I wrote the wrong thing in a commit message.

Baum mit Augen



Answer #1

As already mentioned, git commit --amend is the way to overwrite the last commit. One note: if you would like to also overwrite the files, the command would be

As already mentioned, git commit --amend is the way to overwrite the last commit. One note: if you would like to also overwrite the files, the command would be

git commit -a --amend -m "My new commit message"