Change a Commit Message that Hasn't Been Pushed Yet

Share this video with your friends

Send Tweet

If you make a mistake in a commit message but HAVEN'T pushed it yet, you can change that commit message with --amend:

git commit --amend -m "New message"

This won't change any of the files in your commit - but will rewrite the commit with the new message.