Using git amend
Amending the last commit message
  git commit --amendAmending any other commit message
For example, if the commit message you want to modify is 4 commits back, then first REBASE your repository to the last 4 commit:
  git rebase -i HEAD~4This will open up the commits in $EDITOR. Change the first word on the line which corresponds to the commit you want to modify from pick to reword.
Then modify the commit message as required.
Finally git push --force to send your amended commits upstream.
Reference:
Created on: