In order to change message of last commit:
git commit --amend
then git will open editor and allow us to change commit message. If we use vi / vim as editor to exit we use :wq (write and quit).
To see if we changed our commit message use git log command.
Change message of commit that we already pushed to remote repository
If we already pushed branch to remote repository then we need to use git push with force to override the changes on remote repository.
git push origin FEATURE_BRANCH -f
- -f is shortcut from --force