What I would like to do is to checkout a single file or a set of files with a common name part like this
git checkout myBranch */myFile.md
and
<
None of the other answers worked for me, but bambams comment worked. I made it into a bash function that accepts two args. Usage:
gitcheckout myBranch '*file*'
gitcheckout()
{
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null);
pushd .;
cd $GIT_DIR/../;
git diff --name-only $1 -- $2 | xargs git checkout $1 --;
popd;
}