An agent-authored pull request was merged and broke a feature in production. What is the cleanest rollback path on GitHub?
- Exam domain
- Implement tool use and environment interaction20–25% of the exam
- Difficulty
- Easy
- In this mock
- 17 questions on this domainPractise this domain
Why the exam asks this
Objective in the exam guide: Implement rollbacks.
Every change path needs a way back. The exam checks the GitHub rollback mechanism.
Why A is the answer
Revert the pull request, which creates a new pull request that undoes its changes, and review and merge that
GitHub can revert a merged pull request by creating a new pull request with the inverse changes, which keeps history and goes through normal review.
How it works
Reverting a pull request creates a new pull request that undoes its changes.
History is preserved, so the change and its reversal are both visible.
The revert goes through the same review and checks as any change.
Clues in the question
The words that point to the answer, and what each one tells you.
- Merged and broke production
- Undo a merged change safely.
In detail
- Investigate the root cause after restoring service.
- Add a test that would have caught the bug.
Side by side with look-alikes
| Rollback | Keeps history and review? |
|---|---|
| Revert the pull request | Yes |
| Agent edits main | No |
| Delete history | No |
| Wait for release | Not a rollback |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Revert the pull request, which creates a new pull request that undoes its changes, and review and merge thatRight
GitHub can revert a merged pull request by creating a new pull request with the inverse changes, which keeps history and goes through normal review.
B. Ask the agent to edit main directly to undo the changeWrongMost tempting
Direct edits to main skip review and protections.
Why it tempts: The agent wrote the change, so it seems best placed to undo it. But direct edits to main bypass review, and protections should prevent it.
C. Delete the repository history after the mergeWrong
Rewriting history disrupts everyone.
D. Wait for the next scheduled releaseWrong
Waiting leaves production broken.
In practice
- Keep agent changes small so a revert is easy and safe.