Courseiva

200-901 Software Development and Design Practice Question

A developer is working on a Git repository and needs to temporarily save changes that are not ready to be committed so they can switch to another branch to fix a bug. Which Git command should the developer use to stash the current changes?

⚠ Common exam trap

The trap here is assuming that committing work-in-progress is equivalent to stashing, but committing creates permanent history while stashing is temporary and does not affect the commit log.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

git stash

The git stash command is designed to temporarily store modifications to tracked files and the staging area, allowing a clean working directory. This enables switching branches or performing other operations without committing incomplete work. The stashed changes can be reapplied later with git stash pop or git stash apply, making it ideal for the described scenario.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    git commit -m "WIP"

    Why it's wrong here

    This is incorrect because committing unfinished work creates a permanent record in the branch history. While it does allow switching branches, it pollutes the commit history with incomplete changes that may not be desired. The scenario asks for temporary saving, not permanent recording. Stashing is the appropriate mechanism for temporary storage without affecting the commit graph.

  • ✗

    git branch temp

    Why it's wrong here

    This is incorrect because creating a new branch does not save uncommitted changes. The changes remain in the working directory and would carry over to any branch the developer switches to, potentially causing conflicts. Branching is for diverging work, not for temporarily setting aside changes. Stashing is the correct tool for that purpose.

  • ✓

    git stash

    Why this is correct

    This is correct because git stash saves the current working directory and index state, reverting the working directory to match the HEAD commit. It allows the developer to switch branches without committing unfinished work. Later, git stash pop or git stash apply can restore the changes. This command is specifically designed for temporarily shelving changes.

  • ✗

    git checkout -- .

    Why it's wrong here

    This is incorrect because git checkout -- . discards all unstaged changes in the working directory, reverting files to the last committed state. This would permanently lose the developer's unfinished work, which is the opposite of what is needed. The developer wants to preserve changes temporarily, not destroy them. Stashing is the safe alternative.

About these practice questions

One of 975 original 200-901 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Cisco exam blueprint

This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.