gt undo / gt redo¶
Undo or redo Stack operations.
Usage¶
Arguments¶
| Argument | Description |
|---|---|
[count] |
Number of operations to undo/redo (default: 1) |
Examples¶
Undo Last Operation¶
Undo Multiple Operations¶
Redo Last Undo¶
What Can Be Undone¶
Stack tracks these operations:
gt create- Undo creates deletegt delete- Undo restores the branchgt rename- Undo restores old namegt modify- Undo restores previous commitgt restack- Undo restores previous stategt squash- Undo restores original commits
History Limit¶
Stack keeps history of the last 50 operations per repository.
Viewing History¶
Currently, there's no command to view history. Undo operations are based on chronological order.
Limitations¶
Some operations cannot be undone:
- Operations after
git gc - Changes made outside of Stack commands
- Very old operations (beyond history limit)
Safe Experimentation
The undo feature makes it safe to experiment. Try a restack, and if it doesn't work out, just gt undo.
Related Commands¶
- All Stack commands that modify state support undo