Git has a code base on both the remote and the local side, so updating a single file is a little trickier than SVN. 1. If you want to overwrite local changes with the latest version (or a specific version) on the remote git server, you can use the git pull command, but this will completely update the local code base and working copy. 2. If you want to discard the changes made by the local working copy, you can use the git checkout file/to/path command, but the command can only overwrite your working copy with a local library and cannot get updates from the remote version. Therefore, the correct approach should be to update the local library (but not update the working copy), and then use the local library to update the individual working copy files. as follows: Git fetchgit checkout origin/master--Path/to/file
Donate:)
How Git only updates files in a directory in a project