# Get out of a Git mess without losing work

> Conflicts, a detached HEAD or a rejected push, and every suggested command looks dangerous.

Web page: https://buildladder.com/resources/prompts/git-mess

What you get: A plain explanation of the state you’re in and a safe route out, with a backup taken first.

Paste it into: Your AI tool, in your project

## Prompt to copy

```text
My git repository is in a state I don't understand. Help me get out without losing any work.

Before changing anything, look at the current state and explain it in plain words: which branch I'm on, what's saved and what isn't, how my copy differs from the remote, and whether a merge or rebase is half finished.

Then make a safety copy of everything, including unsaved changes, on a backup branch. Propose the safest way back to a normal state and explain each command before you run it. Don't run anything that discards work (reset --hard, clean, a force push, checkout over files) without showing me exactly what would be lost and getting my OK.
```
