一键导入
git-rollback
Interactively rollback Git branch to historical version; lists branches, versions, then executes reset/revert after confirmation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Interactively rollback Git branch to historical version; lists branches, versions, then executes reset/revert after confirmation
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Professional AI programming assistant with structured workflow (Research -> Ideate -> Plan -> Execute -> Optimize -> Review) for developers
专业AI编程助手,提供结构化六阶段开发工作流(研究→构思→计划→执行→优化→评审),适用于专业开发者
Quickly add a new corporate sponsor to ZCF — sponsor list by default, with optional API preset and documentation ad placements
Create pull request based on current branch changes
Automate version release and code commit using changeset
Automatically check code changes since last tag and update documentation in docs/ directory (en, zh-CN, ja-JP) and CLAUDE.md to ensure consistency with actual code implementation
| name | git-rollback |
| description | Interactively rollback Git branch to historical version; lists branches, versions, then executes reset/revert after confirmation |
| disable-model-invocation | true |
| allowed-tools | Read(**), Exec(git fetch, git branch, git tag, git log, git reflog, git checkout, git reset, git revert, git switch), Write() |
Purpose: Safely and visually rollback a specified branch to an older version.
Defaults to read-only preview (--dry-run); actual execution requires --yes or interactive confirmation.
# Pure interactive: list branches → select branch → list recent 20 versions → select target → choose reset or revert → confirm
/git-rollback
# Specify branch, other interactive
/git-rollback --branch feature/calculator
# Specify branch and target commit, execute with hard-reset in one go (dangerous)
/git-rollback --branch main --target 1a2b3c4d --mode reset --yes
# Generate revert commit only (non-destructive rollback), preview
/git-rollback --branch release/v2.1 --target v2.0.5 --mode revert --dry-run
| Option | Description |
|---|---|
--branch <branch> | Branch to rollback; interactively selected if omitted. |
--target <rev> | Target version (commit hash, tag, or reflog reference); interactively selects recent --depth entries if omitted. |
--mode reset|revert | reset: Hard rollback history; revert: Generate reverse commits keeping history intact. Prompts by default. |
--depth <n> | List recent n versions in interactive mode (default 20). |
--dry-run | Enabled by default, only preview commands to be executed. |
--yes | Skip all confirmations and execute directly, suitable for CI/CD scripts. |
git fetch --all --prunegit branch -a (local + remote, filter protected branches)git log --oneline -n <depth> + git tag --merged + git reflog -n <depth>reset or revert--yes)reset: git switch <branch> && git reset --hard <target>revert: git switch <branch> && git revert --no-edit <target>..HEADgit push --force-with-lease (reset) or regular git push (revert)git switch -c backup/<timestamp>.main / master / production are detected with reset mode enabled, requires additional confirmation.--force provided; if force push needed, manually enter git push --force-with-lease.| Scenario | Command Example |
|---|---|
Hotfix patch deployed with bug, need to rollback to tag v1.2.0 | /git-rollback --branch release/v1 --target v1.2.0 --mode reset |
| Ops colleague pushed debug logs by mistake, need to generate reverse commit | /git-rollback --branch main --target 3f2e7c9 --mode revert |
| Research historical bugs, guide newcomers through branch history | /git-rollback (full interactive, dry-run) |