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.


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 did | Undo |
|---|---|
| Stage, unstage, or stage or unstage lines | Puts back what was staged. Your files don't change. |
| Commit or amend | Moves your branch back. The commit's changes stay, staged. |
| Undo commit, on History's toolbar | Brings the commit back. |
| Make or switch a branch | Switches you back. |
| Rename a branch, or make one at a commit | Renames it back, or removes it. |
| Delete a branch | Brings it back at its commit, but not its upstream or other settings. |
| Make or delete a tag | Removes it, or brings it back. |
| Pull, merge, cherry-pick, revert, or rebase | Moves your branch back where it was. A rebase also puts back the branches that moved with it. |
| Stash | Brings the changes back, while it's still your newest stash. |
| Discard | Puts 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.