rollback_pattern
Reverts all file changes made by a specific pattern replacement call, using its pattern_id to restore affected files byte-for-byte when a replacement causes UI regressions or compile issues.
Instructions
Rolls back ALL changes made by a specific replace_pattern call.
When to use:
- Call when a pattern replacement resulted in unexpected UI behavior or compilation issues.
- Call to safely undo all file changes associated with a pattern_id.
When NOT to use:
- Do not use to revert single token edits (use rollback_last or reject_change instead).
- Do not use without a valid pattern_id from list_applied_patterns.
Side effects:
- DESTRUCTIVE: Modifies source files on disk to restore their pre-replacement states.
What it does: Requires pattern_id from the original replace_pattern response. All files are reverted byte-for-byte.
When to use: When a replace_pattern operation caused regressions and needs complete reversal.
When NOT to use: Cannot undo if files were modified externally. Use rollback_last for single-edit undo.
Side effects: Destructive rollback. Modifies all files touched by the pattern back to their prior state.
Parameters:
- pattern_id: The exact pattern_id from the original replace_pattern response.
Returns:
JSON string with list of reverted files and status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |