Git - Change most recent commit message08 Mar 2014
When using any version control system it’s inevitable that you’re going to make some kind of mistake when writing out your commit messages. Luckily Git makes it extremely simple to change the message of your most recent commit. Simply use the
git commit --amend -m "new message"
For example given this test repository with three previous commits:
To change the message of the most recent commit - in this case “Third commit”, you can use
git commit --amend -m "This is a modified message"
This gives the updated log messages: