diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-25 20:35:10 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-25 20:35:10 +1100 |
commit | 0cf78ea9ad996616467c7f8f73893b9d6bcb940c (patch) | |
tree | cbcdc70ce2994d29243edfe4416facbc43b8f547 /docs/Undoing.md | |
parent | 3d51fbf354b73d6547cabd556bb4165676b19b7e (diff) |
Update Undoing.md
Diffstat (limited to 'docs/Undoing.md')
-rw-r--r-- | docs/Undoing.md | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/docs/Undoing.md b/docs/Undoing.md index 718d9faef..62c800511 100644 --- a/docs/Undoing.md +++ b/docs/Undoing.md @@ -1,10 +1,17 @@ # Undo/Redo in lazygit +![Gif](/docs/resources/undo2.gif) + +## Keybindings: +'z' to undo, 'ctrl+z' to redo + +## How it works + If you're as clumsy as me you'll probably have felt the pain of botching an interactive rebase or doing a hard reset onto the wrong commit. Luckily, the reflog allows you to trace your steps and make things right again, but I personally can't stand trying to make sense of the reflog. -Lazygit can read through your reflog for you and walk back action by action so that you don't even need to read the reflog. Just press 'z' to undo, and press 'ctrl+z' to redo. If lazygit finds a reflog entry where you checked out a branch, we'll checkout the original branch. If the entry is from a commit being applied, we'll go back to the commit before that. If we hit an interactive rebase, we'll go back to the commit you were on just before you started it. +Lazygit can read through your reflog for you and walk back action by action so that you don't even need to read the reflog. If lazygit finds a reflog entry where you checked out a branch, we'll checkout the original branch. If the entry is from a commit being applied, we'll go back to the commit before that. If we hit an interactive rebase, we'll go back to the commit you were on just before you started it. -## Stateless +## You can even undo things you did outside of lazygit! Because lazygit just uses the reflog to keep track of things, it doesn't matter whether you're trying to undo something you did in lazygit or directly on the command line. You can open lazygit for the first time and start undoing thing in your repo! Likewise, lazygit marks its undos/redos in the reflog so if you quit the application and come back, lazygit still knows where you're up to. |