how to discard commit in git code example
Example 1: git remove commit
# Removes latest commit from the stash, KEEPS changes
git reset --soft HEAD~
# Removes latest commit from the stash, DELETES changes
git reset --hard HEAD~
Example 2: git delete local commit
git reset --hard origin/
Example 3: remove the commit from local
git reset --soft HEAD~1
Example 4: revert unpublished commits
git reset --hard
Example 5: how to revert commit in git
git checkout