how to delete old commits in git code example
Example 1: git delete local commit
git reset --hard origin/<branch_name>
Example 2: git clear commits
git reset --hard origin
Example 3: how to delete old commits in github
git reset --hard HEAD^
git push origin -f