Stash vs Worktree

When Stash and Worktree Solve the Same Problem Differently

Both let you drop what you are doing and work on something else. The stash moves your changes out of the way in the one directory you have; a worktree leaves them where they are and gives you a second directory.

Stash versus worktree
Question Stash Worktree
Setup cost None; one command A directory, plus npm 2,036 ci
Uncommitted changes Packed away, then restored Stay untouched in the first tree
Running processes Your dev server sees files vanish Both trees can run at once
Risk Forgotten stashes, pop conflicts Stale directories to prune
Best for Minutes-long interruptions Hours-long parallel work, reviews

Sam's one-line fix fitted the stash; the 1.1.1 release, with a different base commit, fitted a worktree. A third choice is often simplest: commit half-done work on a branch (git switch -c wip/migrations, git commit -am "WIP") and squash it later (Autosquash and Fixup Commits). Once pushed, it is backed up on the server too.