You type the command "git checkout foo".
If there is a branch called "foo" yet no file by that name, it switches to the branch -- and if there is a file by that name and no such branch, it updates the file "foo".
But I wonder --- is there a way to enter the command so that Git will unconditionally interpret "foo" as the name of a branch no matter what? This includes (but is not limited to) the specification that if there is no branch called "foo", the operation will fail even if a file by that name exists.
So - is there any way to do this?
Thanks.