Answers for "how to delete last commit and push from branch"

1

git delete last commit after push

git reset --hard HEAD~1
git push -f <remote> <branch>
Posted by: Guest on April-21-2021
1

delete last pushed commit

$ git reset <previous label or sha1>
$ git commit -am "blabla"                    <--- optional
$ git push -f <remote-name> <branch-name>
Posted by: Guest on April-10-2022

Code answers related to "how to delete last commit and push from branch"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language