how to revert git files locally code example Example 1: undo unstaged changes git git checkout -- . Example 2: git delete changes git clean -df git checkout -- .