git switch vs git checkout

git switch was introduced in Git 2.23 as a safer, more focused alternative to git checkout for switching branches. Use git switch for branches and git restore for files — clearer intent, fewer foot-guns.