I was stuck in a situation seeing error: pathspec 'desired-branch' did not match any file(s) known to git.
for all of the suggestions above. I'm on git version 1.8.3.1.
So this worked for me:
git fetch origin desired-branch
git checkout -b desired-branch FETCH_HEAD
The explanation behind is that I've noticed that when fetching the remote branch, it was fetched to FETCH_HEAD:
$ git fetch origin desired-branch
From github.com:MYTEAM/my-repo
* branch desired-branch -> FETCH_HEAD