{
  "id": 5239923,
  "title": "I Ran git reset --hard in the Wrong Window",
  "url": "https://urgent.news/2026/09/03/i-ran-git-reset-hard-in-the-wrong-window",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-03T03:38:02.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/rbonweb/i-ran-git-reset-hard-in-the-wrong-window-2ihd"
  },
  "original_language": "en",
  "account": "On June 25th, a developer made a grave error by executing the command \"git reset --hard\" in the incorrect repository window at 6:40pm. This action erased three commits of unfinished work from their working directory in under a second. Fortunately, the Git reflog, a local log of recent changes to HEAD, allowed the developer to recover the deleted commits. The reflog entry showed the reset operation moved to HEAD~3, which corresponds to the three lost commits.\n\nHowever, if commits were never committed in the first place, the reflog cannot help as it only tracks HEAD and branch pointer movements, not file contents. In such cases, committing frequently and using \"wip\" (work in progress) commits can be the only solution. If the reflog has expired after 90 days, Git fsck --unreachable can sometimes recover the unreferenced commit objects. But the developer now maintains a habit of running destructive Git operations first in a disposable clone of the repository to ensure they function as intended, then applying them to the actual repository. This practice, known as \"rehearsing\" the operation, costs little time and effort but can save significant work.",
  "summary": "git reset --hard HEAD~3 — run in the wrong repository window, at 6:40pm, immediately followed by the specific kind of silence that happens when you realize what you just did before your brain finishes processing it. Three commits of uncommitted-adjacent work, gone from the working tree in under a second. The first, most important fact: it's very likely still there git reset --hard moves the…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}