rollback

rollback is a command for coding agents from qinye6/pi-ccg. It costs 22 tokens per session (769 once invoked), scanned A, a copy of rollback, MIT.

An interactive command for moving a Git branch back to an earlier commit, tag, or saved reference. Git is a tool that records code history; reset changes that history, while revert adds new commits that undo earlier ones.

In plain words
What is it for?
Use it to preview or perform a branch rollback, either by rewriting history with reset or by preserving history with revert.
Why use it?
It helps you choose the right branch and version while reducing the chance of undoing work by mistake. It previews the commands and asks for confirmation by default.

Command

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.

agentmods
npx agentmods add commands/qinye6/pi-ccg/rollback
Clone the repo
git clone --depth 1 https://github.com/qinye6/pi-ccg
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 769 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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 $0.00022 $0.00769
Opus 5 $0.00011 $0.00385
Sonnet 5 $0.00004 $0.00154
Haiku 4.5 $0.00002 $0.00077

Measured 3d ago against content hash 26734c16106e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rollback 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 3d 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.

Origin

This is a copy

100% identical to rollback — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

templates/commands/rollback.md · 117 lines

What it actually says

Rollback - 交互式 Git 回滚

安全地将分支回滚到指定历史版本,默认 dry-run 模式。

使用方法

/rollback [options]

选项

选项 说明
--branch <branch> 要回滚的分支
--target <rev> 目标版本(commit/tag/reflog)
--mode reset|revert 回滚模式
--depth <n> 列出最近 n 个版本(默认 20)
--dry-run 只预览,不执行(默认
--yes 跳过确认直接执行

执行工作流

🔍 阶段 1:同步远端

[模式:准备]

git fetch --all --prune

📋 阶段 2:选择分支

[模式:选择]

  1. 列出本地 + 远端分支
  2. 过滤受保护分支
  3. 用户选择或使用 --branch 参数

📜 阶段 3:选择版本

[模式:选择]

  1. 显示最近 N 个版本(git log --oneline
  2. 显示相关 tags(git tag --merged
  3. 用户选择或使用 --target 参数

⚙️ 阶段 4:选择模式

[模式:决策]

模式 说明 推送方式
reset 硬回滚,改变历史 --force-with-lease
revert 生成反向提交,保留历史 普通 push

⛔ 阶段 5:最终确认

[模式:确认]

显示即将执行的命令,等待用户确认(除非 --yes)。

✅ 阶段 6:执行回滚

[模式:执行]

reset 模式

git switch <branch>
git reset --hard <target>

revert 模式

git switch <branch>
git revert --no-edit <target>..HEAD

安全护栏

  1. 备份:执行前自动记录当前 HEAD 到 reflog
  2. 保护分支main/master/production 需额外确认
  3. dry-run 默认:防止误操作
  4. 禁止 --force:如需强推,手动执行

示例

# 全交互模式(dry-run)
/rollback

# 指定分支
/rollback --branch dev

# 完整指定,一键执行
/rollback --branch main --target v1.2.0 --mode reset --yes

# 生成反向提交
/rollback --branch release/v2.1 --target v2.0.5 --mode revert

注意事项

  • reset vs revert:reset 改变历史,需强推;revert 更安全
  • LFS/子模块:回滚前确保状态一致
  • CI 触发:回滚后可能自动触发流水线
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. 3d ago First seen · 117 lines · 22 tokens per session scan A 26734c16106e

Subscribe to this mod's changes

rollback is a command published in the GitHub repository qinye6/pi-ccg (10 stars, last pushed 9d ago), licensed MIT. It adds 22 tokens to every session and 769 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to rollback, differing in 0 lines, and is treated as a copy.