revert changes of one file git code example Example: git reset change in one file # undo local changes to specific file git checkout -- file