git remove unstaged changes to file code example Example: undo unstaged changes git git checkout -- .