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