Courseiva
hardMultiple ChoiceObjective-mapped

200-901 Practice Question: A developer is using Git for version control of a…

A developer is using Git for version control of a Python library. A colleague accidentally committed a large sensitive file. Which Git command sequence should be used to remove the file from history without losing subsequent changes?

⚠ Common exam trap

Cisco often tests the distinction between removing a file from the working tree versus removing it from the entire commit history, leading candidates to mistakenly choose `git rm` or `git revert` which only affect the latest state, not the historical record.

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 or git filter-repo

`git filter-branch` and `git filter-repo` are designed to rewrite Git history, allowing you to permanently remove a large sensitive file from all commits. This is necessary when a file has been committed and pushed, as simple removal with `git rm` only affects the latest commit and leaves the file accessible in prior history. Using these commands ensures the file is purged from the entire repository history without losing subsequent changes, as they replay the commit graph while filtering out the specified file.

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 filter-branch or git filter-repo

    Why this is correct

    These tools rewrite history, removing the file from all commits.

  • git rm --cached && git commit

    Why it's wrong here

    This only removes the file from the index, not history.

  • git rebase -i && git commit --amend

    Why it's wrong here

    Interactive rebase can remove file from a specific commit but is cumbersome for many commits.

  • git revert HEAD

    Why it's wrong here

    Revert creates a new commit that undoes changes but the file remains in history.

About these practice questions

Courseiva writes every 200-901 question from scratch — 989 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.