git remove local changes to file code example
Example 1: remove local changes git
git fetch # will fetch the latest changes on the remote
git reset --hard origin/master # will set your local branch to match the representation of the remote just pulled down.
Example 2: git undo all changes
git reset --hard
Example 3: undo unstaged changes git
git checkout -- .