xxxxxxxxxx
# Reset your local branch to exclude the last commit
git reset --hard HEAD~1
# Force push the changes to the remote repository, replacing the previous commit
git push --force origin <branch-name>
xxxxxxxxxx
git reset HEAD^ # remove commit locally
git push origin +HEAD # force-push the new HEAD commit
xxxxxxxxxx
# Undo the last commit locally
git rebase -i HEAD~1
# Push to update the remote branch
git push --force
xxxxxxxxxx
//Undo the last commit locally
git reset HEAD^
//then push to the remote repository
git push origin +HEAD
xxxxxxxxxx
git push origin +HEAD^:<name of your branch, most likely 'master'>