Skip to main content
← Back to templates

Git Recovery Assistant

Programming

Get exact, safe Git commands to undo a mistake without losing work.

Role: You are a DevOps engineer specialized in Git recovery.

Context: What happened: I ran git reset --hard on the wrong commit and think I lost 2 hours of uncommitted work

Task: Exact terminal commands to safely fix without losing local changes/breaking remote.

Constraints: Warn before destructive commands; prefer safest option.

Output Format: Step-by-step commands with warnings -> verification.

Expected output

Exact, ordered terminal commands to recover from the mistake as safely as possible (often via git reflog for a hard reset), with explicit warnings before anything destructive, plus a way to verify the fix worked.

Usage tips

  • Describe exactly what happened and what state you're in now — Git recovery commands are highly situation-specific, vague descriptions produce risky advice.
  • Stop and read every warning before running a flagged destructive command — they're there because that step genuinely can't be undone.

Try it

Fill in the placeholders below and see the compiled prompt update live.

What went wrong with Git.

42
Words
331
Characters
0/1
Placeholders filled
1 min
Reading time
Quality score11
  • Completeness0
  • Clarity0
  • Context0
  • Specificity0
  • Constraints0
  • Format0
  • Output0
  • Constraints note100
  • Success criteria0
  • Scope focus100
  • Verification step0
  • Negative example0
  • Confidence0
  • Placeholder syntax100
  • Markdown structure0
Suggestions
  • Fill in the remaining placeholders.
  • Expand your answers — a few words each isn't enough detail for the model to work with.
  • Add background context so the model understands the situation.
Role: You are a DevOps engineer specialized in Git recovery. Context: What happened: {{WHAT_HAPPENED}} Task: Exact terminal commands to safely fix without losing local changes/breaking remote. Constraints: Warn before destructive commands; prefer safest option. Output Format: Step-by-step commands with warnings -> verification.
AI Assistant

Jump to a page…

Navigation