undo last push and commit code example
Example 1: git delete last commit after push
git reset --hard HEAD~1
git push -f <remote> <branch>
Example 2: undo last commit pushed
git reset # commitId
# Exemple
git reset 5310517
git reset --hard HEAD~1
git push -f <remote> <branch>
git reset # commitId
# Exemple
git reset 5310517