agentleFS
elfrostelfrost/ai-patchlab/.agents/skills/rollback/SKILL.md

rollback

Skill1 starsChanged 30 days agoMITView on GitHub

Safely roll back recent changes — uncommitted edits, last commit, range of commits, or back to a specific commit. Always uses `git revert` (preserves history) and `git stash` (preserves work). Never `git reset --hard`.

  • Deletes or force-pushes

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use plan, ship and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 4 projects that use this

  • AWSSkill

    ship

    Finalize dev work on an issue branch — update docs, push, and open a PR.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 4

    Distinctive

    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:

    NEVER use git reset --hard — always git revert

    line 57
  2. Distinctive:

    Always show the user what will be affected before acting

    line 59
  3. Distinctive:

    Always require confirmation before any destructive action

    line 60
  4. Distinctive:

    If tests fail after rollback, warn the user immediately

    line 61

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “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

Rollback

Phase 1: Assess

git status
git log --oneline -10
git diff --stat

Show: branch, last 10 commits, uncommitted state, files modified.

Phase 2: Identify the target

Ask the user: "Qu'est-ce que tu veux rollback?

  1. Les changements non-commités (stash)
  2. Le dernier commit (revert)
  3. Les X derniers commits (revert range)
  4. Revenir à un commit spécifique (revert chain)"

Phase 3: Execute the chosen option (always confirm first)

Option 1 — Uncommitted changes

Show git diff and git diff --cached. Confirm with the user, then:

git stash save "rollback-backup-<timestamp>"

Tell the user: "Recoverable via git stash pop."

Option 2 — Last commit

Show git log -1 --stat. Confirm. Then:

git revert HEAD --no-edit

Option 3 — Last X commits

Show git log --oneline -X. Confirm. Then:

git revert HEAD~X..HEAD --no-edit

Option 4 — Specific commit

Show git log --oneline -20. Ask for the hash. Then revert all commits after that one.

Phase 4: Verify

git log --oneline -5
git status
pytest tests/ -v --tb=short

Report: what was rolled back, current state, whether tests pass.

Rules

  • NEVER use git reset --hard — always git revert
  • NEVER use git checkout . — always git stash
  • Always show the user what will be affected before acting
  • Always require confirmation before any destructive action
  • If tests fail after rollback, warn the user immediately

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.