$npx -y skills add Archive228/loopkit --skill revert-surgicalUndo a bad change without nuking unrelated work. Use when a specific commit or change broke something.
| 1 | # Surgical Revert |
| 2 | Don't `git reset --hard` away three good commits to undo one bad one. |
| 3 | - **Single commit** — `git revert <sha>` creates an inverse commit; history stays intact and shared-branch-safe. |
| 4 | - **One file from a commit** — `git checkout <good-sha> -- path/to/file`. |
| 5 | - **Hunk-level** — `git checkout -p` to revert specific changes, keep the rest. |
| 6 | - **A merge** — `git revert -m 1 <merge-sha>` (pick the mainline parent). |
| 7 | On a shared branch, always revert (forward), never rewrite history. Reproduce the breakage first so you revert the RIGHT thing, then verify the revert actually fixes it. |