git-revert-safety

git-revert-safety is a skill for OpenCode from ZaxbyHub/opencode-swarm. It costs 79 tokens per session (2,085 once invoked), scanned A, original, MIT.

A procedure for safely undoing Git commits and recovering from unwanted merges or branch changes. It includes checking affected files, choosing between reverting and cherry-picking, and verifying the result.

In plain words
What is it for?
Use it when reverting commits, undoing merges, handling contaminated branches, or checking the changes after a revert.
Why use it?
It reduces the chance that an undo operation will accidentally remove release data, dependencies, changelog entries, or other unrelated work.

Skill for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: mentions OpenCode.

Good fit Use it when reverting commits, undoing merges, handling contaminated branches, or checking the changes after a revert.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zaxbyhub/opencode-swarm/git-revert-safety
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ZaxbyHub/opencode-swarm --skill git-revert-safety
Clone the repo
git clone --depth 1 https://github.com/ZaxbyHub/opencode-swarm

Made for: OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git-revert-safety

README.md
[![agentmods](https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/git-revert-safety/github.svg)](https://agentmods.dev/skills/zaxbyhub/opencode-swarm/git-revert-safety)
Your own site
<a href="https://agentmods.dev/skills/zaxbyhub/opencode-swarm/git-revert-safety"><img src="https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/git-revert-safety/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git-revert-safety

Your own site · 80×15
<a href="https://agentmods.dev/skills/zaxbyhub/opencode-swarm/git-revert-safety"><img src="https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/git-revert-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,085 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00079 $0.02085
Opus 5.5 $0.00032 $0.00834
Sonnet 5.5 $0.00016 $0.00417
Haiku 4.5 $0.00008 $0.00209

Measured 7d ago against content hash ea90ec570888, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git-revert-safety scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/skills/generated/git-revert-safety/SKILL.md · 192 lines

How it starts

The opening of the file, as written. The whole thing — 192 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git Revert Safety Protocol

Two internal workflows: Safe Git Revert (Steps 1-4) and Branch Contamination Recovery (Steps 5-6). Use the first when reverting known commits. Use the second when the wrong code was merged and you need a clean slate.


Workflow A — Safe Git Revert

Step 1 — Collateral Damage Assessment

Before reverting, list ALL files touched by each commit being reverted. Use the correct command for the situation:

Single commit:

git show --name-only --format= <sha>

Multiple commits (contiguous range):

git diff --name-only <commit-before-first>..<last-commit-sha>

Merge commit — inspect all parents (handles octopus merges with 3+ parents):

git show --format="%H %P" <merge-sha>   # Shows ALL parent SHAs
git log --oneline <merge-sha>^1         # First parent (usually main)
git log --oneline <merge-sha>^2         # Second parent (feature branch)
# For octopus merges: also inspect ^3, ^4, etc.

Identify which files in the diff are NOT part of the feature being reverted:

  • .release-please-manifest.json — version state
  • package.json — version field + dependency additions/removals
  • CHANGELOG.md — release history
  • Lockfiles (bun.lock, package-lock.json) — dependency graph
  • Any config files modified by release PRs between the feature and now

dist/ is generated and NOT committed, so it never appears in a revert diff and needs no rebuild+commit as part of a revert — reverting the source is enough.

Gate: If ANY version metadata or dependency file appears in the diff, you MUST verify post-revert state (Step 3).

Step 2 — Choose Recovery Strategy

Scenario Strategy Caveat
Single commit that does NOT touch release/build artifacts git revert <sha> Still verify metadata diff after
Single commit that DOES touch release artifacts Verify post-revert metadata manually May need corrective commit
Multi-commit revert, no releases between git revert <sha1> <sha2>... Verify each commit's file scope
Multi-commit revert, releases between Cherry-pick fix onto fresh branch Avoids collateral damage from reverse-apply
Merge commit revert git revert -m <parent-number> <merge-sha> Must specify correct parent (usually -m 1 for main)
Branch contamination (wrong code merged) Fresh branch + cherry-pick See Workflow B
Revert of revert (re-apply feature) git revert <revert-sha> ⚠️ Code may have drifted — check for conflicts
Squash merge revert Fresh branch + cherry-pick preferred Squash merges have no merge-parent metadata
Octopus merge (3+ parents) Fresh branch + cherry-pick unless parent is unambiguous -m parent selection is error-prone; prefer clean slate

Read the full file on GitHub · 192 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago Changed · -8 lines ea90ec570888
  2. 12d ago Changed · +1 lines f0aee0ceab84
  3. 1mo ago First seen · 199 lines · 79 tokens per session scan A ff89776998a7

Subscribe to this mod's changes

git-revert-safety is a skill published in the GitHub repository ZaxbyHub/opencode-swarm (510 stars, last pushed today), licensed MIT. It adds 79 tokens to every session and 2,085 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

autofix-pr

Watch a pull request and fix it from a worktree of its own - CI failures, review feedback from trusted authors and merge conflicts are fixed, pushed to the PR branch and answered on the PR under the user's git and gh identity. Usage - /autofix-pr [ | ] [--once] [--every ] [--no-reply] [--yes] [instructions]…

QwenLM/qwen-code · 123 tokens

repo-hygiene

Use when the scheduled repo-hygiene workflow runs from GitHub Actions (or an operator dry-run) to scan the repository for small, certain docs/test/code hygiene issues and fix them as one batched branch.

QwenLM/qwen-code · 48 tokens

create-issue

Draft and submit a GitHub issue from a user idea or bug description, with bilingual body and correct labels.

QwenLM/qwen-code · 26 tokens

docs-update-from-diff

Review local code changes with git diff and update the official docs under docs/ to match. Use when the user asks to document current uncommitted work, sync docs with local changes, update docs after a feature or refactor, or when phrases like "git diff", "local changes", "update docs", or "official docs" appear.

QwenLM/qwen-code · 75 tokens

prepare-pr

Prepare GitHub pull request title and body files from the current branch diff, especially for non-interactive CI/autofix flows that must follow the repository PR template without pushing or creating the PR.

QwenLM/qwen-code · 42 tokens

triage

Gatekeep and review GitHub issues and pull requests for Qwen Code maintainers. Use for GitHub Action issue triage, PR admission checks, product-direction review, KISS-focused PR review, and staged bilingual GitHub comments.

QwenLM/qwen-code · 50 tokens