I just did something dumb. In my fooclient project, I just did:
git remote add official https://github.com/fooserver
git pull official master
In other words, I pulled a completely different codebase (the server, instead of the client) into my working directory. Not surprisingly, there weren't many merge conflicts (the file names are all completely different, after all). Also not surprisingly, Git completely failed to warn me that the repos didn't have a single common ancestor.
In this particular situation, I'm able to recover by doing this:
cp file-i-worked-on.js ~
git reset --hard HEAD # to discard broken merge conflicts
git checkout a12345 # where a12345 is the latest head of fooclient that I had checked out
cp ~/file-i-worked-on.js .
But what would be the more general strategy?