change commit message for non-last commit code example Example: change last commit message git commit --amend -m "New commit message."