rollback

rollback is a command for coding agents from fengshao1227/ccg-workflow. It costs 22 tokens per session (769 once invoked), scanned A, original, MIT.

An interactive Git command for moving a branch back to an earlier commit, tag, or saved reference. It supports reset, which changes branch history, and revert, which adds new commits that undo earlier ones.

In plain words
What is it for?
Use it to roll back a branch, inspect recent versions, choose between changing or preserving history, and safely handle protected branches.
Why use it?
It helps recover from unwanted changes while showing the planned commands and asking for confirmation; preview mode is the default.

Command

Part of the ccg plugin — 58 skills, 12 commands, 7 agents shipped together

About the project

CCG is a command-line workflow engine that coordinates Claude, Codex, Gemini, and other models as specialized collaborators on coding tasks. It is used to analyze requests, choose a strategy, delegate work to model-specific roles, and combine their results. The catalogue entries provide the skills, commands, agents, and plugin that implement this workflow.

fengshao1227/ccg-workflow · 5,872 stars · on GitHub

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/fengshao1227/ccg-workflow/rollback
Clone the repo
git clone --depth 1 https://github.com/fengshao1227/ccg-workflow

Or install ccg, the plugin that ships this one along with the rest of its 58 skills, 12 commands, 7 agents.

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 rollback

README.md
[![agentmods](https://agentmods.dev/badge/commands/fengshao1227/ccg-workflow/rollback.svg)](https://agentmods.dev/commands/fengshao1227/ccg-workflow/rollback)
Your own site
<a href="https://agentmods.dev/commands/fengshao1227/ccg-workflow/rollback"><img src="https://agentmods.dev/badge/commands/fengshao1227/ccg-workflow/rollback.svg" alt="Measured on agentmods" height="20"></a>
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 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 $0.00022 $0.00769
Opus 5 $0.00011 $0.00385
Sonnet 5 $0.00004 $0.00154
Haiku 4.5 $0.00002 $0.00077

Measured 5d 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 5d 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

Copies of this mod

1 near-identical copy found in the catalogue:

  • rollback — 100% identical, 0 lines differ
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. 5d 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 fengshao1227/ccg-workflow (5,872 stars, last pushed yesterday), 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. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.