$ git commit --amend -m "New and correct message"
$ git commit --amend -m "New and correct message"
git checkout branch_name
git commit --amend -m "Modified message"
# if previous commit is not pushed yet
git push
# or if previous comment was pushed in a previous commit:
git push --force-with-lease branch_name
git commit --amend -m "an updated commit message"
# make your change
git add . # or add individual files
git commit --amend --no-edit
# now your last commit contains that change!
# WARNING: never amend public commits
git commit --amend -m "New commit message for most recent commit"
git commit --amend -m "new commit message"
$ git push --force-with-lease branch-name