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, switch to another branch to fix a bug, and then return to the original branch and reapply the saved changes. Which Git command should be used to accomplish this?

⚠ Common exam trap

Test-takers frequently confuse temporary storage with committing or discarding changes, leading to data loss or unwanted commits.

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

git stash is designed to temporarily save uncommitted changes, allowing a clean working directory to switch branches. After handling the urgent bug fix, the developer can return and reapply the stashed changes. The other options either commit, discard, or misconfigure branches, none of which preserve work-in-progress.

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 checkout -- .

    Why it's wrong here

    git checkout -- . discards changes in the working directory, reverting files to the last committed state. This would permanently lose the developer's uncommitted work, which is the opposite of what is needed. The scenario requires preserving changes, not discarding them.

  • ✗

    git branch --set-upstream-to

    Why it's wrong here

    This command sets the upstream branch for tracking, which has nothing to do with saving uncommitted changes. It is used to configure remote tracking, not to temporarily store modifications. Using it would not address the need to switch branches while preserving local changes.

  • ✗

    git commit -m "WIP"

    Why it's wrong here

    Committing work-in-progress creates a permanent commit on the current branch, which is not desired when the changes are not ready. It would also require an extra commit to revert or amend later. The scenario specifies temporarily saving changes, not committing them, so git stash is more appropriate.

  • ✓

    git stash

    Why this is correct

    git stash temporarily shelves changes in the working directory, allowing the developer to switch branches without committing. After fixing the bug, git stash pop or git stash apply restores the changes. This is the standard way to handle unfinished work when an urgent branch switch is needed.

About these practice questions

This 200-901 question is part of Courseiva's 975-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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.