How to edit incorrect commit message in git?

Solution 1 : Using Editor
You can edit the message for your last commit using following command:
git commit --amend
When you run this command, an editor will be opened, showing the last commit message.
Simply edit the message, then Save and Close the file.
You can verify whether the commit message was changed or not using following command:
git log
Solution 2 : Through Command Line
You can set the commit message directly in the command line with:
git commit --amend -m "New commit message"
…however, this can make multi-line commit messages or small corrections more cumbersome to enter.
Make sure you don’t have any working copy changes staged before doing this or they will get committed too. (Unstaged changes will not get committed.)