revert all changes to original in git for local branch code example Example 1: git undo all changes git reset --hard Example 2: undo unstaged changes git git checkout -- .