undo all commits git code example
Example 1: git delete local commit
git reset --hard origin/<branch_name>
Example 2: revert unpublished commits
git reset --hard <hash-or-ref>
git reset --hard origin/<branch_name>
git reset --hard <hash-or-ref>