Skip to content
Download

Undo

Almost everything you do in Commitline can be taken back, with Git itself, without losing your work.

Take back your last action

Press Ctrl+Z (⌘Z on a Mac), or choose Edit › Undo, while no text box has the focus.
Commitline takes back the newest action in the repository in front.

While you're typing, in a commit message say, Ctrl+Z undoes your typing instead; click outside the box first.

Recent actions

Recent actions, the button at the end of the Git view's title, lists what you did in this repository, newest first, such as Commit on main with its time.
Choose one to undo it.

Recent actions open on the Git view: Commit on main and Stage on main, each with its time and UndoRecent actions open on the Git view: Commit on main and Stage on main, each with its time and Undo

An action that can't be undone, or can't be any more, is greyed out.
Once undone, an action leaves the list, so nothing is undone twice.

What undo puts back

You didUndo
Stage, unstage, or stage or unstage linesPuts back what was staged. Your files don't change.
Commit or amendMoves your branch back. The commit's changes stay, staged.
Undo commit, on History's toolbarBrings the commit back.
Make or switch a branchSwitches you back.
Rename a branch, or make one at a commitRenames it back, or removes it.
Delete a branchBrings it back at its commit, but not its upstream or other settings.
Make or delete a tagRemoves it, or brings it back.
Pull, merge, cherry-pick, revert, or rebaseMoves your branch back where it was. A rebase also puts back the branches that moved with it.
StashBrings the changes back, while it's still your newest stash.
DiscardPuts back the discarded files from their checkpoint. See Discard and checkpoints.

Undo never throws away a change you made since: when something it would put back has moved, Commitline says so and leaves everything as it is.

What can't be undone

  • Fetch, push and force push: they change the remote, not just your computer.
  • Resolving a conflict, Continue and Abort, in a merge, rebase, cherry-pick or revert.
  • A discard when checkpoints are turned off.

How long it remembers

Commitline remembers the last 50 actions of each repository while it's running; quitting forgets them.
Settings › Git › Actions to keep for undo sets how many, from 1 to 500.

An action made in another worktree of the repository can be undone only there.
During a merge, rebase, cherry-pick or revert, finish or abort it before you undo anything.

There's no Redo for Git actions: to redo one, do it again.