remove remote commit from github code example
Example 1: how to delete old commits in github
git reset --hard HEAD^
git push origin -f
Example 2: how to undo a commit from remote
git reset --hard HEAD~3
git push -f
git reset --hard HEAD^
git push origin -f
git reset --hard HEAD~3
git push -f