To modify an existing, unpushed commit message, you can use the git commit --amend command. This allows you to change the message of the most recent commit. Simply make the changes to the message, save and close the editor, and the commit message will be updated.
If you want to modify an older commit message, you can use the git rebase -i command to enter interactive rebase mode and choose the commit you want to modify. Once you’ve made the changes, save and close the editor and the commits will be updated.
It’s important to note that modifying commit messages after they’ve been pushed to a remote repository can cause issues for other contributors, so it’s best to avoid doing this unless it’s absolutely necessary.