Changing a commit message - GitHub Docs

Commit has not been pushed online

If the commit only exists in your local repository and has not been pushed to GitHub.com, you can amend the commit message with the git commit --amend command.

Use the git rebase -i HEAD~n command to display a list of the last n commits in your default text editor.

# Displays a list of the last 3 commits on the current branch
$ git rebase -i HEAD~3
# p, pick = use commit
# r, reword = use commit, but edit the commit message