I am trying to checkout a single file from a remote branch but am having trouble with the proper syntax. If this file was on master, I could run (link):
$ git checkout origin/master -- path/to/file
but if I run a similar command with my branch name I get:
$ git checkout origin/my-branch-name -- path/to-file
fatal: invalid reference: origin/my-branch-name
What is the equivalent command to check out this single file on a remote branch?