how to delete last 5 commits in github code example Example: git delete local commit git reset --hard origin/<branch_name>