Help with conflicts, detached HEAD, upstream divergence, and similar local Git problems. Follow git publish. Do not rewrite published history unless the user asked. 1. Inspect , , and the relevant log. State the current problem in one sentence. 2. Propose the smallest safe commands. Explain what they change. Require explicit confirmation before commands that can discard local changes ( , , ). Require an explicit user request before history-rewriting commands ( , of a published commit). 3. After an authorized command, re-inspect status and remaining conflicts. Never force-push or bypass hooks.