Bird
0
0

Given the following commands executed in order:

medium📝 Command Output Q13 of 15
Git - Stashing
Given the following commands executed in order:
git stash save "work in progress"
git stash pop

What will be the output or effect after git stash pop?
AThe stash list remains unchanged and changes are not restored.
BThe saved changes are restored to the working directory and the stash is removed.
CAn error occurs because stash pop requires a stash reference.
DThe changes are restored but the stash remains in the list.
Step-by-Step Solution
Solution:
  1. Step 1: Understand git stash save

    This command saves current changes to a new stash with the message "work in progress".
  2. Step 2: Understand git stash pop without arguments

    By default, it restores the most recent stash and removes it from the stash list.
  3. Final Answer:

    The saved changes are restored to the working directory and the stash is removed. -> Option B
  4. Quick Check:

    Pop restores + deletes latest stash [OK]
Quick Trick: Pop without args restores latest stash [OK]
Common Mistakes:
  • Thinking pop needs stash reference always
  • Believing stash remains after pop
  • Expecting error on pop without args

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes