Undo
Undo and recover
2 min read
Git rarely loses work for real, but finding what disappeared usually takes commands few people remember. Versora has several safety nets, each one for a kind of loss: an operation done by mistake in the app, a file overwritten by the editor, half-finished work that needs to get out of the way, a local file that shouldn't go into the commit.
| Feature | Protects against | Where it lives | After closing the app |
|---|---|---|---|
| Undo and redo (Ctrl+Z / Ctrl+Shift+Z) | An operation done in the app: commit, merge, rebase, reset, checkout, deleting a branch, tag or stash, applying a stash or patch, discards, conflict resolutions | In the app's memory (up to 40 operations per repository). The copies of discarded files are kept in refs/versora/undo/* (the 20 most recent). | The stack is lost; the copies stay in the repository |
| Timeline (Alt+Z) | Several operations in a row: go back or redo up to a point, seeing first what changes | The same stack as Ctrl+Z | The stack is lost |
| Named points | A risky experiment: save the whole state and go back to it later | In the repository, in refs/versora/points/* | They stay |
| Local history (Alt+H) | A file overwritten by the editor, deleted in File Explorer, discarded from the terminal | In the git folder, in versora-history | It stays (up to the days and space limits) |
| Stash and snapshot | Half-finished work that needs to get out of the way (or be saved without leaving) | In git's stash list | It stays |
| The "don't commit" list | A local file (configuration, draft) that would go into the commit by mistake | In the git folder, per worktree | It stays |
| Reflog | Commits that left every branch (reset, rebase, a branch deleted outside the app) | In git | It stays |
- Just did something wrong in the app? Ctrl+Z.
- Want to go back several steps at once, knowing what will change? The timeline.
- About to try something risky (a big rebase, a cleanup)? Mark a named point first.
- Lost the content of a file that wasn't committed yet? The local history.
- Lost a commit? The reflog.
The guide How to recover lost work shows, situation by situation, which feature to use.
- Undo and redo: what Ctrl+Z undoes, what it doesn't, the backup copies and the refusals.
- Timeline and named points: the undo stack as a list over time, "Go back to here", "Redo up to here" and the points that survive closing the app.
- Local file history: the automatic copies of files with uncommitted changes, comparing and restoring.
- Stash: creating one with a title and description, what to save (everything, only staged changes, snapshot), stashing a file, hunk or lines, apply, pop, delete, applying part of it and exporting it as a patch.
- The "don't commit" list: files that are left out of "stage all" and that the commit only takes with confirmation.
- How to recover lost work: the guide by situation.