[Git] Edit the latest commit message

Created on November 30, 2026

You can use git commit --amend to change the message of the most recent commit. Run it with an empty staging area if you are only editing the message.

git commit --amend

Edit the message in the editor that Git opens. Amending creates a commit with a new hash, so account for anyone using the old commit if it has already been shared.

Git