Don't use `git checkout` for anything:

- use `git switch` to switch between branches
- use `git restore` to restore files from a given tree

`checkout` has always been regrettably overloaded with those two capabilities, and nowadays you can avoid it by using commands designed for the purpose

0

If you have a fediverse account, you can quote this note from your own instance. Search https://hachyderm.io/users/llimllib/statuses/115888308731362353 on your instance and quote it. (Note that quoting is not supported in Mastodon.)