git restore modification to file code example Example 1: undo unstaged changes git git checkout -- . Example 2: git delete changes git clean -df git checkout -- .