agentleFS
rpraharajrpraharaj/ai-engineer/skills/revert-change/SKILL.md

revert-change

Skill1 starsChanged 16 days agoMITView on GitHub

Safely undo a commit, merge, PR, or deploy without rewriting shared history. Use when the user asks to revert, roll back, undo a merge, or back out a change. Do not reset shared branches. Do not invent a third behavior.

  • Deletes or force-pushes

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read AGENTS.md if present.

    line 17
  2. Distinctive:

    Stop if you cannot name the target.

    line 29
  3. Distinctive:

    Do not push unless asked. If they want it on the remote, push the revert commit (no force) or say the reset is local only.

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Revert change

Undo a known change. Prefer a new revert commit. Do not reset --hard or force-push a branch other people use.

For a live incident, use the action and evidence already recorded by incident-triage; do not restart triage when it has already selected rollback. If no action is selected, run triage first. Operational rollback may proceed without git; source-history changes require git.

Read AGENTS.md if present.

Target

Identify exactly what to undo: commit SHA, merge commit, PR/MR, tag, or release. If the user said "the last change" and HEAD is yours and not on a shared default branch, that is enough.

git log -8 --oneline
git status --short
git rev-parse --abbrev-ref HEAD

Stop if you cannot name the target.

How to undo

SituationDo
Shared branch, already pushed, or a mergeCreate a new git revert commit. For a merge, inspect its parents and choose the mainline that preserves the intended branch history; never assume parent 1.
Unpushed local commits, your branch only, user said undogit reset --soft to keep files, or git reset --hard only if they asked to discard
Deploy / release already outRun the documented operational rollback first when safe (prior artifact or flag), checking data compatibility. Source-history repair is a separate follow-up if needed and authorized; restoring service does not require a git revert. If no rollback exists, report the missing operation rather than inventing an inverse command.
Default branch (main / master / trunk)Revert only. Never reset it.

Preserve unrelated dirty files and staging. Inspect the target diff and merge parents before undoing source changes; do not use reset or stash to clear unrelated work. Do not rewrite other people's commits. Do not --force to main / master / trunk.

Load engineering-bar (paths in that skill) Secret files. Stop a source revert that would restore secrets; explain the blocked content and construct a safe targeted undo instead. Disclosure alone does not permit committing secrets.

Prove

After operational rollback, check the original symptom and the affected service's health using the recorded incident window; report recovered, still degraded, or unverified. Record the running artifact/flag and any incompatible data remaining. For source changes, run AGENTS.md Test (and Lint / Typecheck if cheap). If the revert was to stop a fire, a focused test or health check is enough; say what you did not run.

Done

  1. Target (SHA / PR / release)
  2. Method (revert / reset / deploy rollback)
  3. New commit hash, or that history was reset
  4. Commands and results
  5. What is still live in production (if you could not roll that back)

Do not push unless asked. If they want it on the remote, push the revert commit (no force) or say the reset is local only.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.