git revert all files to previous commit code example Example 1: git undo all changes git reset --hard Example 2: git delete changes git clean -df git checkout -- .