Skip to content
Versora

Manual

Undo

Undo and recover

2 min read

On this page

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.

The safety nets

FeatureProtects againstWhere it livesAfter 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 resolutionsIn 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 changesThe same stack as Ctrl+ZThe stack is lost
Named pointsA risky experiment: save the whole state and go back to it laterIn 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 terminalIn the git folder, in versora-historyIt stays (up to the days and space limits)
Stash and snapshotHalf-finished work that needs to get out of the way (or be saved without leaving)In git's stash listIt stays
The "don't commit" listA local file (configuration, draft) that would go into the commit by mistakeIn the git folder, per worktreeIt stays
ReflogCommits that left every branch (reset, rebase, a branch deleted outside the app)In gitIt stays

Which one to use

  • 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.

Pages in this area

  • 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.

See also