git get commit message of last commit code example Example: how to fix the last commit message git commit --amend -m "New commit message."