how to discard last pull in git code example Example 1: undo git pull git reset --hard master@{"10 minutes ago"} Example 2: revert last commit git reset HEAD~