To change commit message we use following command:
$ git commit --amend
It will open our editor and allow us to change the commit message of the most recent commit.
We can set the commit message directly in the command line with following command:
$ git commit --amend -m "New commit message"