# Undo the last commit locally
git rebase -i HEAD~1
# Push to update the remote branch
git push --force
git reset --hard HEAD^
git push origin -f
//Undo the last commit locally
git reset HEAD^
//then push to the remote repository
git push origin +HEAD
1
$git rebase -i HEAD~2