how to delete commit in github already pushed code example
Example 1: delete a pushed commit
# delete the last commit
$git reset –hard HEAD~
Example 2: remove commit not pushed
git reset --hard origin/main
# delete the last commit
$git reset –hard HEAD~
git reset --hard origin/main