A common mistake after I’ve done a commit is I may have forgotten to include some key details about my latest changes, so I want to update the previous message that I left when I committed. Luckily, there is an option to pass that allows me to change my message.
git commit --amend -m "New message here"
That’s it. Please note that if you’ve already pushed your commit to a remote repository then this will not work as this fix is meant to be implemented before a push is done.