<!--
ROBOTS ON PAYROLL / THE VAULT
What this is: the recovery prompt to paste into an AI when git is in a scary state and you want back to the last version that worked.
How to use it: download this file and give it to your AI (Claude, ChatGPT,
Cursor, Lovable chat) as a reference. Say: "Use this as my playbook for [task]."
Latest version + full guide: https://robotsonpayroll.com/resources/github-for-normal-people
-->

# The "Help, I Broke It" Prompt

For the moment when git is showing you words like "conflict", "detached HEAD", or "your branch has diverged", the app won't run, and you have no idea what state anything is in.

First: breathe. If you ever committed and pushed a working version, it still exists and this prompt will find it. Git almost never loses work; it just gets into states that look terrifying to humans.

Paste the whole block below into an AI that can run commands on your project (Claude Code, Cursor's agent, Replit's assistant). If your AI can't run commands, it can still walk you through it: add one line at the top saying "You can't run commands, so give them to me one at a time and I'll paste back what I see."

---

## The prompt

> Something has gone wrong with git in this project and I need your help. I do not code. Treat me accordingly: plain English, no jargon without a one-line explanation, one step at a time.
>
> Here's what happened, as best I can describe it: [WHAT YOU DID / WHAT THE AI DID / WHAT THE SCREEN SAYS. Paste any error messages in full. "I don't know, it just broke" is an acceptable answer.]
>
> Do this, in this order:
>
> 1. DIAGNOSE FIRST, TOUCH NOTHING. Inspect the state of the repository using only read-only commands. Then explain to me, in plain English and under 10 sentences: what state my project is in, how it got there (best guess), whether any of my work is at risk of being lost, and what the last few saved versions are (dates and messages).
> 2. PROPOSE A PLAN. Tell me which saved version you recommend returning to and why, plus what, if anything, we would lose by doing that (for example: work done after that version that was never committed). If there is uncommitted work worth keeping, your plan must stash or back it up first, and you must tell me where the backup lives.
> 3. WAIT FOR MY GO-AHEAD. Do not run anything that changes state until I say yes to the plan.
> 4. THEN EXECUTE ONE STEP AT A TIME. Before each command: one sentence on what it does and why. After each: confirm it worked. Wait for me to say "next" between steps.
>
> Hard rules, no exceptions:
> - Never delete anything, discard changes, or force-overwrite anything without telling me first, in plain English, exactly what would be lost, and getting an explicit yes from me for that specific action.
> - Prefer reversible moves over clean ones. An extra "undo commit" in the history is fine; erased history is not.
> - No force push, no hard reset, no deleting branches, unless you have explained the consequence and I have said yes to that exact command.
> - If at any point you are not sure what state we're in, stop and say so rather than guessing.
>
> We are done when: the app is back to a version that worked, that version is committed and pushed to GitHub, and you have given me a two-sentence summary of what went wrong and what we did, so I can avoid it next time.

---

## After you recover

Do one thing: save (commit and push) immediately, with a message like "Recovered to working version". Then, if you want the scare to mean something, ask the same AI: "What one habit would have made this recovery trivial?" The answer is almost always "commit more often", and hearing it right after the adrenaline is how it sticks.
