mediumMultiple ChoiceObjective-mapped
FC0-U71 Practice Question: A team is using version control for a software…
A team is using version control for a software project. A developer accidentally committed a buggy change to the main branch. Which action should the team take to fix this while preserving the commit history?
⚠ Common exam trap
Test-takers frequently confuse `git revert` with `git reset`, thinking that deleting the commit from history (Option D) is acceptable, but CompTIA tests that preserving history on a shared branch is a fundamental version control best practice.
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
✓
Use the revert command to create a new commit that undoes the changes.
The `git revert` command creates a new commit that undoes the changes introduced by a previous commit, effectively fixing the buggy code while preserving the full commit history. This is the standard, safe approach in Git for undoing changes on a shared branch like main, as it does not rewrite history or require force-pushing.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Ask all developers to manually undo the changes in their local copies.
Why it's wrong here
Manual fixes are error-prone and do not create a consistent fix in the repository.
- ✓
Use the revert command to create a new commit that undoes the changes.
Why this is correct
Revert safely undoes changes while preserving the existing commit history.
- ✗
Delete the repository and start over.
Why it's wrong here
This is drastic and loses all other work; not a standard fix.
- ✗
Force delete the commit from history.
Why it's wrong here
Force deleting history can cause issues for collaborators and is not recommended.
Go deeper
Related to this question
About these practice questions
One of 988 original FC0-U71 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This FC0-U71 practice question is part of Courseiva's free CompTIA 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 FC0-U71 exam.