Courseiva
mediumMultiple Choice

200-901 A team is using Git for version control Practice Question

A team is using Git for version control. A developer accidentally committed a sensitive file. Which Git command should be used to remove the file from the repository history while keeping it locally?

⚠ Common exam trap

Cisco often tests the distinction between removing a file from future commits (git rm --cached) versus purging it from all history (git filter-branch), trapping candidates who confuse 'keeping locally' with 'removing from history'.

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 filter-branch

Git filter-branch, because it rewrites the entire repository history to remove a file from all commits, effectively purging it from the version history while leaving the local working copy untouched. This is the standard Git approach for permanently deleting sensitive data (e.g., passwords, API keys) from the repository's history.

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 rebase -i

    Why it's wrong here

    Interactive rebase rewrites commit order and messages but does not purge a file's blob from every commit in history. It is tempting because rebase edits commits, yet the sensitive content persists in earlier objects. Removing it requires git filter-repo or filter-branch, which rewrite all affected commits.

  • ✗

    git reset --soft

    Why it's wrong here

    git reset --soft moves HEAD only, leaving the index and working tree untouched, so the committed file remains in history. It is tempting because reset undoes commits, but it does not erase blobs from prior commits. Purging history requires git filter-repo or filter-branch, which rewrite every affected commit.

  • ✗

    git rm --cached

    Why it's wrong here

    git rm --cached only untracks the file from the index, leaving it in the working directory and in all previous commits. It is tempting because it stops future tracking, but the blob remains retrievable from history. Removing it requires git filter-repo or filter-branch to rewrite the affected commits.

  • ✓

    git filter-branch

    Why this is correct

    git filter-branch rewrites commits across the entire repository history, stripping the sensitive file from every past commit while leaving the working copy untouched. Simpler commands such as git rm only affect future commits, so the file would persist in earlier history.

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 by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.