git remove last commit push new commit code example Example: git delete last commit after push git reset --hard HEAD~1 git push -f <remote> <branch>