AgentSkillsCN

git-revert-recovery

在 Git 历史、分支管理、同步或恢复工作流是核心关注点时,采用明确的回退策略来安全地从有问题的合并或提交中恢复的专业化工作流。当 Git 历史、分支管理、同步或恢复工作流是核心关注点时,可选用此流程;但请勿将其用于 CI 工作流设计或应用行为的实现。

SKILL.md
--- frontmatter
name: git-revert-recovery
description: "Specialized workflow for recovering safely from problematic merges or commits using explicit revert strategy. Use when Git history, branching, synchronization, or recovery workflows are the core concern; do not use for CI workflow design or application behavior implementation."

Git Revert Recovery

Trigger Boundary

  • Use when already-pushed commits must be undone safely.
  • Do not use for private local history cleanup; use git-rebase-workflow.
  • Do not use as a substitute for root-cause analysis in incidents.

Goal

Restore stable behavior quickly without destructive history rewriting.

Shared Git Contract (Canonical)

  • Use ../git-branch-strategy/references/git-governance-contract.md as the single schema and gate source.
  • Track revert artifacts with GIT-RVT-* IDs.
  • Run machine validation: python3 ../git-branch-strategy/scripts/validate_git_contract.py --manifest <path/to/manifest.json>.

Inputs

  • Problematic commit or merge identifiers
  • Blast radius and urgency assessment
  • Verification and communication requirements

Outputs

  • GIT-RVT-* revert execution record
  • Validation results for recovered branch state
  • Follow-up action list for permanent fix

Workflow

  1. Confirm rollback target and expected recovered behavior.
  2. Choose revert scope (single commit, range, or merge revert).
  3. Execute revert and resolve any secondary conflicts.
  4. Validate critical paths and regression-sensitive flows.
  5. Communicate rollback impact with security review evidence.

Quality Gates

  • Revert target is explicitly identified and justified.
  • Recovery validation passes for critical user paths.
  • Rollback communication includes impact and ownership.
  • Security Reviewer approval is present for GIT-RVT-* artifacts.

Failure Handling

  • Stop when revert scope is ambiguous or unverified.
  • Escalate when rollback does not restore expected stability.