HN Hall of Fame Weekly email

On undoing, fixing, or removing commits in git

sethrobertson.github.io Books & learning Tutorials & guides Software engineering Candidate
Screenshot of sethrobertson.github.io captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 8 calendar years, with breakout response in 2 of them.

submissions
13
submitters
13
observed span
2013–2023
peak thread · 73 comments
157 pts
latest 20+ return · 2018-01-30
157 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

easiest method (this article glosses over it): use BFG 2000: https://rtyley.github.io/bfg-repo-cleaner/

fnord77·157-point thread·

Regarding losing data: it's as simple as diving into the reflog. In order to remove something from your history, you must do so very explicitly by walking your commit history, editing each one. There is an automated workflow to accomplish that (`filter-branch`) but it's definitely not a command anyone I know has committed to memory. Accidental mutations can be undone either by `--abort`ing (if the command supports it) or by checking out an earlier revision from the reflog. The GC…

sisk·105-point thread·

On a similar note is this flowchart which walks you through recovering from various Git mistakes: http://justinhileman.info/article/git-pretty/

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
2

100+ points or 50+ comments

Total points
359

reference only — not used in Hall rules or ranking

Total comments
88

reference only — not used in Hall rules or ranking

Every submission