You have multiple kitchens (branches). git checkout lets you teleport between them — instantly swapping everything on your counter.
Your main kitchen has the official recipe.
Your feature kitchen has an experimental chocolate glaze.
Your hotfix kitchen has an urgent temperature fix.
git checkout doesn't copy files —
it replaces your entire working directory with the version from that branch.
Like teleporting to a whole different kitchen.
You've seen how checkout swaps your entire workspace.
Each branch has its own version of your files —
and switching is instant.
Pro tip: git switch
is the modern, less confusing replacement for checkout (switching branches only).