Coding tips
git switch vs git checkout: Differences, Equivalent Commands, Detached HEAD, Remote Branches and Common Errors (Tested Examples)
git switch only changes branches, while git checkout changes branches and also restores files. Here is a tested comparison in Git 2.47.3: the equivalent commands, creating branches, remote tracking, detached HEAD, typo errors, local changes and orphan branches.