This skill uses an automated script to ensure that when rolling back a Git commit, not only is the current attempt preserved (Snapshot), but also, through ARCHIVE.md , a traceable decision chain is constructed.
Core Workflow
1. Confirm the rollback target
- Obtain the target Commit Hash that the user wants to roll back to.
- Ask about or summarize the specific reason (Reason) for the rollback.
2. Execute the automated rollback script
- Before execution, you must ask the user whether the archive branch needs to be pushed to the remote repository.
- Use
run_shell_commandto call the skill's built-in script:- If the user agrees to push:
python3 <path_to_skill>/scripts/rollback.py <Target_Commit> "<Reason>" --push - If the user does not agree to push (default):
python3 <path_to_skill>/scripts/rollback.py <Target_Commit> "<Reason>"
- If the user agrees to push:
- The script will automatically complete:
- Commit all current uncommitted changes.
- Create the
archive/{current_branch}/YYYY-MM-DD-HH-mmbranch. - Update the archive branch's
ARCHIVE.mdrecord. - (Optional) Push the archive branch to the remote.
- Return to the original branch and execute
git reset --hard。 - Update
ARCHIVE.mdon the original branch and commit the rollback record. - List all branches currently ahead of the remote (unpushed).
3. Result verification
- Check whether
ARCHIVE.mdhas correctly recorded the bidirectional link for this rollback. - Confirm that the current branch is now at the target Commit state.
Recording conventions
- Regarding
ARCHIVE.mdfor the specific format, please refer to references/log-format.md。 - The Commit Message of each rollback must include information about the source archive branch.
Usage prohibitions
- It is strictly prohibited to directly execute
git reset --hardto discard a large amount of work without using this skill. - Do not modify or delete
ARCHIVE.mdthe historical records in.