Spot the Stash Mistake
Question
This sequence stashes, switches branches, and pops. What could go wrong?
Code
git stash
git checkout other-branch
git stash pop
Hint
Stash pop can cause conflicts if the target branch has changed.
Explanation
Stashed changes were made relative to the original branch. When you pop them on a different branch, the file states may not match, causing conflicts. If this happens, you must resolve the conflicts manually. To avoid this, stash and pop on the same branch, or use git stash branch <new-branch> to create a branch from the stash.
Related Resources
Related Lessons
Related Cheatsheets
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.