git switch and git restore, not checkout
checkout does two unrelated jobs, and the dangerous one, discarding your changes to a file, is the one that is easy to type by accident.
git switch feat/thing # change branch
git switch -c feat/new # create one
git restore src/app.ts # discard changes to a file
git restore --staged src/app.ts # unstageSame operations, names that say which one you meant.
git