Change the wrong commit message in Git

commit, git

Solution

Lose the first `-a` you aren't adding any files, you're just changing the HEAD commit:

git commit --amend -m"New Commit Message"

Problem

I a have a small problem with Git commit. So I am working on some project and using Git. I did a Git commit and I accidentally wrote a wrong commit message. So my question is: Is there anyway I can change the commit message in Git? NOTE: I have tried to do this way: ``` git commit -a --amend -m "New Commit Message" ``` But it doesn't work. Why? Thanks.

Original source

Related problems