All challenges

Git · medium

Time machine recovery

#14

Situation

You hard-reset main one commit too far. The ledger refactor vanished from the branch tip and the working tree is back to its old state. Git still remembers recent HEAD moves, and the deploy window is closing. Find the lost tip and restore main.

Objective

Restore the lost tip on main. The ledger refactor must be committed again, the working tree must be clean, and the history must contain two commits.

The repo at start

repo/
└── src/
    └── ledger.ts   (tip was hard-reset away)

Checks you will turn green

  • HEAD is main with the refactor tip restored
  • Ledger file is the refactor, clean
  • Nothing staged

Concepts

reflogresethard reset

Play it in your terminal

With sharpen installed, this command opens exactly this challenge in your local arena:

sharpen 14

First time? The full install is right below.

How to play

  1. 1 Install Claude Code if you do not have it yet: claude.com/claude-code
  2. 2 Install sharpen from npm:
    npm install -g @juanwmedia/sharpen
  3. 3 Then launch it; the arena opens in your browser:
    sharpen 14
  4. or Or try it without installing anything:
    npx @juanwmedia/sharpen 14
  5. 4 And to update when a new version ships:
    sharpen update