The branch exists only on the remote and is not fetched
CommonSomeone pushed the branch after your last fetch (or your clone is shallow or single-branch), so your repository has no record of it.
Confirm
git branch -a | grep NAME git ls-remote --heads origin NAME
Nothing locally, but a line from ls-remote (the branch exists on the remote)
Fix
- Fetch, then check it out: git fetch origin, then git checkout NAME (or git switch NAME).
- For a single-branch or shallow clone: git fetch origin NAME:NAME, or git remote set-branches origin '*' followed by git fetch.
git fetch origin && git checkout NAME
Reproduced on Git 2.50.1: creates a local branch tracking origin/NAME.