I did git stash from the branch. How to get my files before git stash?
git stash
git checkout other-branch
git stash pop
I did not save them before.
I did git stash from the branch. How to get my files before git stash?
git stash
git checkout other-branch
git stash pop
I did not save them before.
If you mean "I want my files as they were before I ran the initial git stash
" : go back to the commit you were in before you called git checkout other-branch
, and reapply the stash
# clean your worktree :
git stash
# go back to the previous branch :
git checkout the/active/branch/before/other-branch
# apply the stash :
git stash pop
You can use git stash apply
instead of git stash pop
if you want to "apply the stash" several times.
If you mean : "I want my files as they were before I ran git stash pop
", just re-stash the content :
git stash