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.
npx skills add flasherses/claude-code-dotfiles --skill git-rollbackgit clone --depth 1 https://github.com/flasherses/claude-code-dotfilesWrote 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.
[](https://agentmods.dev/skills/flasherses/claude-code-dotfiles/git-rollback)<a href="https://agentmods.dev/skills/flasherses/claude-code-dotfiles/git-rollback"><img src="https://agentmods.dev/badge/skills/flasherses/claude-code-dotfiles/git-rollback/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.
<a href="https://agentmods.dev/skills/flasherses/claude-code-dotfiles/git-rollback"><img src="https://agentmods.dev/badge/skills/flasherses/claude-code-dotfiles/git-rollback.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00071 | $0.00930 |
| Opus 5.5 | $0.00028 | $0.00372 |
| Sonnet 5.5 | $0.00014 | $0.00186 |
| Haiku 4.5 | $0.00007 | $0.00093 |
Grade A, and why
git-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 2mo 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.
What it actually says
Git Rollback — 回滚最后一次 Commit
目标
撤销最近一次 git commit,根据模式保留或丢弃变更。不可逆操作,必须由用户显式触发。
前置检查
执行前必须完成以下检查,任一失败则中止:
# 1. 确认在 git 仓库中
git status 2>$null
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ 不在 git 仓库中"; exit 1
}
# 2. 检查是否有未提交变更(可选保护)
$uncommitted = git status --porcelain
if ($uncommitted) {
Write-Host "⚠️ 存在未提交的变更:"
Write-Host $uncommitted
Write-Host "这些变更不会被回滚影响,但建议先处理"
}
# 3. 显示即将回滚的 commit
Write-Host "`n即将回滚的 commit:"
git log -1 --format=" %h — %s (%an, %ar)"
三种回滚模式
| 模式 | 命令 | commit | 暂存区 | 工作区 |
|---|---|---|---|---|
--soft |
git reset --soft HEAD~1 |
撤销 | ✅ 保留 | ✅ 保留 |
--mixed |
git reset --mixed HEAD~1 |
撤销 | ❌ 清空 | ✅ 保留 |
--hard |
git reset --hard HEAD~1 |
撤销 | ❌ 清空 | ❌ 丢弃 |
默认模式: --mixed(最安全)
hard 模式: 需要用户二次确认
执行流程
Step 1: 确定模式
- 如果用户没有指定模式 → 使用
--mixed - 如果用户说了
soft/--soft→ 使用--soft - 如果用户说了
hard/--hard→ 必须二次确认
Step 2: 二次确认(hard 模式专用)
Write-Host "⚠️ HARD 模式将永久丢弃所有变更!"
Write-Host "最近一次 commit 的内容:"
git show --stat HEAD
$confirm = Read-Host "确认执行 hard reset?(输入 YES 继续)"
if ($confirm -ne "YES") {
Write-Host "已取消"; exit 0
}
Step 3: 执行
# soft 或 mixed
git reset <mode> HEAD~1
# 然后显示结果
Write-Host "`n回滚后的状态:"
git log -1 --format=" HEAD → %h — %s (%ar)"
git status --short
⚠️ 易错点
- 已 push 的 commit — 如果 commit 已经推送到远程,回滚后需要
git push --force才能同步。这会覆盖远程历史——绝对不要在 main/master 上做,只在个人分支上做。 - hard reset 不可恢复 — 一旦执行,变更只能通过 reflog 找回(
git reflog+git cherry-pick)。 - merge commit 回滚 —
HEAD~1在 merge commit 上可能行为不符合预期,需要加-m 1参数。
回滚后的恢复
如果用户后悔了回滚操作:
git reflog # 找到回滚前的 commit hash
git reset --hard <commit-hash> # 恢复到该 commit
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.
- 2mo ago First seen · 99 lines · 71 tokens per session scan A b21f1d993e50
git-rollback is a skill published in the GitHub repository flasherses/claude-code-dotfiles (6 stars, last pushed 3mo ago), licensed MIT. It adds 71 tokens to every session and 930 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-08-31.
git-rollback compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| git-rollbackflasherses/claude-code-dotfiles | Skill | 6 | 3mo ago | MIT | A | 71 | Claude Code |
| create-prprisma/orm | Skill | 48k | today | Apache-2.0 | A | 48 | Claude Code, Codex |
| git-commitThinkInAIXYZ/deepchat | Skill | 6.4k | today | Apache-2.0 | A | 15 | Claude Code, Codex |
| repo-syncdavidondrej/skills | Skill | 4.3k | today | MIT | A | 25 | Claude Code, Codex |
| engineer-bot-opsmakecindy/cindy | Skill | 9.7k | today | Apache-2.0 | A | 57 | Claude Code, Codex |
| mcore-split-prNVIDIA/skills | Skill | 3.9k | today | Apache-2.0 | A | 25 | Claude Code |
| contributingHugoRCD/evlog | Skill | 1.9k | 4d ago | MIT | A | 68 | Claude Code, Codex |