Undo anything
MyTwig is built so you can try things. Most actions can be taken back with ⌘Z, and put back again with ⇧⌘Z or ⌘Y.
What undo covers
Section titled “What undo covers”- commits and amends
- pulls, merges and rebases, including interactive rebases
- checkouts
- creating, renaming and deleting branches
- stashing, snapshots, popping and dropping stashes
- discarding files or lines
- absorb, split commit, patches and restacks
After many actions a toast at the bottom of the window says what happened, with an Undo button. The toast stays while your pointer is over it.
Discarded changes are kept
Section titled “Discarded changes are kept”Before discarding a file or some lines, MyTwig saves what it had in a hidden ref under refs/mygit/discarded/, outside the graph. That’s what makes discard undoable.
The operation timeline
Section titled “The operation timeline”Every operation that rewrites branches or throws work away first saves the repository as it was. Operation Timeline (in the Repository menu and the palette) lists those states, newest first.
Choose one and click Restore This State…. MyTwig shows exactly what will change: which branches move, come back or are deleted, and which files change. Restoring puts back your local branches, what’s checked out, what’s staged and your working tree. Remote branches, tags and stashes are left alone. The current state is saved first, so you can undo the restore too.
Still lost?
Section titled “Still lost?”View → Reflog shows every move of HEAD, including commits no branch points to anymore. Right-click one to make a branch there.