The most detailed free FDE + DevOps library: 140+ lessons, 70+ labs and 80 long-form articles, in English and Turkish. Start learning →

DevOps Foundations · Module 4: Git and team workflow · Lab

Revert a Published Mistake Without Breaking History

40 min hands-on · Core

Local Git with two clones of a scratch repo (author + teammate) under /tmp/dlab-m04-02.

Two ways to do this lab: in your browser on Killercoda (free, no install), or on your own machine as a local guide. Killercoda runs one free scenario at a time: if you see a waiting queue, close other Killercoda tabs and wait a minute.

Objectives

  • Publish a bad change to a shared scratch branch
  • Revert it so both clones converge with normal pulls
  • Contrast with the divergence a reset plus force would cause
  1. Step 1

    Publish the mistake

    In the author clone, commit a visibly bad default to main, push to the scratch remote, and pull it in the teammate clone. Both checkouts now hold the bad commit.

  2. Step 2

    Revert and converge

    Revert the commit on main, push, and pull normally in both clones. Show both logs: bad commit plus revert, identical on both sides, no divergence warnings.

  3. Step 3

    Show the forbidden alternative

    In scratch only, demonstrate what reset --hard plus force-push does to the teammate clone (divergence warning, forced recovery). Then delete the scratch repos. State the rule in one sentence.

How to confirm it worked

  • Both clones converge with plain pull after the revert
  • History shows bad commit plus revert; nothing rewritten
  • The reset-force divergence is demonstrated in scratch and stated as forbidden on shared branches
  • Scratch repos deleted afterward