If git status shows:
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: FooBar.xcodeproj/project.pbxproj
Isn’t git checkout supposed to bring it back?
$ git checkout FooBar.xcodeproj
error: pathspec 'FooBar.xcodeproj' did not match any file(s) known to git.
How can git correctly restore this folder?
FooBar.xcodeprojis obviously a directory and not directly under version control. What you might try doing is forcing it to checkout the file again: