how to remove recent commit in git code example
Example 1: remove last commit git
git reset --hard HEAD^
git push origin -f
Example 2: how to undo commit
git reset <commitId>
# Exemple
git reset 5310517
git reset --hard HEAD^
git push origin -f
git reset <commitId>
# Exemple
git reset 5310517