Docs
What undo covers
Cmd+Z takes back the last thing Kelp did to your repository, and Cmd+Shift+Z does it again. Undo would rather refuse than lose your work.
What it covers
Anything Kelp changes in your repository on your Mac can be undone:
- Commits and amends. Your changes come back, staged as they were.
- Checkouts, and creating, renaming or deleting a branch or tag.
- Merges, rebases, pulls, cherry-picks, reverts and resets, including a hard reset.
- Interactive rebases and edits to any commit message.
- Staging and unstaging.
- Discarding files, hunks or lines, including new files that were never committed.
- Stashing, applying, popping, dropping and renaming stashes.
- Restoring a branch from the reflog.
Hover the Undo button in the toolbar to see what it will undo before you press it.
How it works
Before each action, Kelp notes where your branches, tags and stashes point and saves a snapshot of your staged and unstaged files. Undo puts all of it back the way it was.
- Kelp keeps the last 50 actions for each open repository.
- Snapshots are kept as hidden refs under
refs/kelp/undoin the repository, so git never cleans them up while you might need them. Kelp removes them the next time it opens the repository, so the undo list starts fresh each time. - Undo only affects your own copy. Nothing is sent anywhere.
What it refuses, and why
When an action can't be undone, hovering the Undo button tells you why. These are the cases:
| Action | Why undo refuses |
|---|---|
| The repository changed since, for example you committed from the terminal | Going back would throw away the newer change. Kelp says so and changes nothing. |
| Push, deleting or renaming a remote branch, pushing or deleting a remote tag | It changed the remote. Other people may already have what you pushed. |
| Fetch and prune | Fetching only updates remote branches, so there is nothing of yours to put back. |
| Adding, removing, moving or pruning a worktree | Worktree folders live outside the repository and are not tracked by undo. |
| Updating a submodule | Submodules are separate repositories. |
| Adding, renaming or removing a remote, or changing its URL | Remote settings are not tracked by undo. |
| Discarding more than 16 MB of new, never committed files at once | Kelp keeps a copy of new files so it can bring them back, and it will not hold that much in memory. It still asks before it discards. |
The reflog safety net
Git remembers every place your branches and HEAD have pointed to, even after a reset or a rebase. This list is the reflog, and it is how you get back work that looks lost after undo can't help, for example after you quit Kelp.
- Open the reflog page from the Local section menu in the sidebar, from a branch menu, or by typing "reflog" in the command palette (Cmd+K).
- Entries are newest first. Commits that are no longer on any branch are marked lost.
- Restore the current branch to any entry with one click. Kelp uses
git reset --keep, so it will not overwrite changes you haven't committed, and the restore itself can be undone. - You can also create a branch from an entry, check it out, or cherry-pick it.
By default git keeps reflog entries for lost commits for 30 days, and 90 days for everything else, so a lost commit is usually still there weeks later.