xxxxxxxxxx
git switch targetBranch # target branch where to pull
git restore --source sourrceBranch -- file.js #pull file from sourceBranch
xxxxxxxxxx
git checkout origin/master -- path/to/file
// git checkout <local repo name (default is origin)>/<branch name> -- path/to/file will checkout the particular file from the downloaded changes (origin/master).
xxxxxxxxxx
git switch targetBranch # target branch where to pull
git restore --source sourrceBranch -- file.js #pull file from sourceBranch