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