how to revert single file in local branch fetch from master branch code example Example: git origin master some file git checkout origin/master -- path/to/file