git commit --amend -m <message>

Change the commit message in the last commit

It overwrites the last commit message with "New message." If no other changes have been added with git add since the last commit, the commit content remains the same.

However, if some other changes have been added to the staging area since the last commit, this command will add them as part of the last commit while also changing the commit message.

Specific examples:
git commit --amend -m "feat: added Button component"

Sign in to enable bookmarking, reminders, progress-tracking and more...