Back to Cookbook

Git Rescue

Describe the mess, get the fix

Committed to the wrong branch, messed up a rebase, or reset something you shouldn't have? Describe what happened in plain English and get the exact commands to recover safely.

House RecipeWork1 min

INGREDIENTS

🐙GitHub

PROMPT

I need help with a git situation. I'll describe what happened in plain English. Give me the exact git commands to fix it. For each command: (1) explain what it does, (2) warn me if it's destructive or rewrites history, (3) suggest a safer alternative if one exists. If my description is ambiguous, ask clarifying questions before giving commands. Never suggest a force push without explicitly flagging the risk. What happened: [describe your git situation here]

How It Works

Tell your Claw what happened in plain English. It gives you the exact

git commands to fix it, explains what each command does, and flags any

history-rewriting or destructive step before you run it.

What You Get

  • Plain-English to git-command translation
  • Step-by-step recovery plans for common git mistakes
  • Explanations of what each command actually does
  • Clear warnings before resets, rebases, force pushes, and branch deletes
  • Safer alternatives when one exists

Setup Steps

  1. Describe what you expected to happen
  2. Describe what actually happened
  3. Review the proposed commands carefully
  4. Run the safe path first

Tips

  • Include branch names and whether you've already pushed to a remote
  • Paste the exact git error if you have one
  • Especially useful for rebases, detached HEAD, bad merges, and accidental commits to `main`
  • Ask for "the safest possible recovery" if you're unsure
  • Great second recipe after Shell Translator because the input is simple and the output is concrete
Tags:#git#version-control#debugging#development