Change commit messages of unpushed commit in git
Learn how to modify/edit existing, unpushed commit messages in GIT. Find out how to change the commit message of the most recent commit.
We can use the –amend flag in git commit command to modify the commit messages.
Syntax
git commit --amend
Example
git commit --amend -m "New commit message"
Please make sure you don’t have any working copy changes staged before changing the commit message using the above command otherwise they will get committed too.