git commit --amend -m "New commit message"
Then
git push --force
and you're done
git commit --amend
$ git push --force origin example-branch
git commit --amend -m "New commit message"
Then
git push --force
git push --force <repository> <branch>
git push --force-with-lease <repository> <branch>