Introduction
This guide explains how to apply files from a stash in Lazygit without removing the stash entry. This method is useful for reapplying changes from a stash while keeping the stash intact for future use.
Lazygit
-
Open Lazygit and navigate to the 5. Stash panel.
-
Use the
↓
/↑
keys to select the stash entry you want to apply. -
Once the desired stash is selected, press the
spacebar
to apply the changes from the stash to your working directory. -
After pressing
spacebar
, the changes in the selected stash will be applied, but the stash entry itself will remain in the stash list.- Add#screenshot showing the selected stash and the action of applying it.
-
Verify the changes:
-
Check your working directory to ensure that the changes from the stash have been correctly applied.
-
Add#screenshot of the working directory after applying stash.
-
Basic Terminal
To achieve the same in the basic terminal:
-
List available stashes to find the one you want to apply:
-
Apply the stash without removing it from the stash list (replace
stash@{n}
with the correct stash identifier): -
Check your working directory to confirm the changes:
- Use
git status
or manually inspect the files to ensure the stash’s changes are present.
- Use
This method provides a straightforward way to reapply stashed changes while retaining the stash for potential future use.