how to checkout a single file from git code example Example: git checkout single file git fetch git checkout origin/master -- path/to/file