remove the last pushed commit code example
Example 1: remove last commit git
git reset --hard HEAD^
git push origin -f
Example 2: delete a pushed commit
# delete the last commit
$git reset –hard HEAD~
git reset --hard HEAD^
git push origin -f
# delete the last commit
$git reset –hard HEAD~