Choose a Temporary Work Strategy
Match the interruption to the tool
For a brief interruption, a named stash may be convenient if you know exactly which files it includes. For substantial unfinished work that needs a stable history, a private WIP commit can be easier to review and recover. For parallel work on two branches, a linked worktree avoids switching the unfinished directory. A branch name by itself does not save unstaged changes. None of these approaches alone is a backup outside the repository.
Private WIP commit
In an independent disposable checkout on a private feature branch, review the intended files. Stage only those safe to commit; commit a clear temporary message. Inspect the resulting snapshot. Do not publish unfinished work or secrets by accident. Later history cleanup is a separate choice and must not rewrite a shared branch without coordination. Untracked or ignored files not selected still need separate preservation.
git status --shortgit diff -- notes.txtgit add -- notes.txtgit diff --cachedgit commit -m "WIP: draft watering notes"git show --stat HEADDecision guide
A ten-minute interruption with two tracked edits: stash with a descriptive message and apply after returning. An overnight experiment with a useful checkpoint: use a private WIP commit and a durable backup if necessary. A hotfix that needs repeated testing while feature edits remain open: use a separate worktree. A need to transfer work to another computer: use authorized transfer or backup, not merely a local stash or another worktree.
Verify before switching context
Write down the current branch, what remains uncommitted and where the saved work lives. Inspect status, selected stash patch or commit snapshot and the worktree list. Test restored behavior before removing temporary records. If interrupted again, use a unique message and recheck stash selectors. Exercise: choose a worktree for parallel hotfix work, then explain why the shared stash and refs prevent it from being an independent backup.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Choose a Temporary Work Strategy — knowledge check
Reason about temporary Git work and recovery.
Which tool best fits simultaneous work on two different branches?
What does a private WIP commit preserve?
What does creating a branch alone save?
Which is a true independent backup strategy?
What should happen before deleting temporary records?