I have been using PhpStorm and recently stashed a load of my changes. At some point after that, my PC profile became corrupt and had to be rebuilt.
Now that I have a new PC profile, PhpStorm is not showing my stashed changes.
Is there any way I can get them back?
All are stored in . git/refs/stash . git stash saves stashes indefinitely, and all of them are listed by git stash list . Please note that dropping or clearing the stash will remove it from the stash list, but you might still have unpruned nodes with the right data lying around.
Note that the stash is local to your Git repository; stashes are not transferred to the server when you push.
To retrieve changes out of the stash and apply them to the current branch you're on, you have two options: git stash apply STASH-NAME applies the changes and leaves a copy in the stash. git stash pop STASH-NAME applies the changes and removes the files from the stash.
Git stash saves the uncommitted changes locally, allowing you to make changes, switch branches, and perform other Git operations. You can then reapply the stashed changes when you need them. A stash is locally scoped and is not pushed to the remote by git push .
From the docs, the latest one is stored in ./.git/refs/stash
while older ones are in the reflog
of that ref
.
As an aside, I've found it's a bad practice to maintain a regular use of git stash. Generally, prefer many small commits on a feature branch. This way you rarely have to stash and when you do it's very little stored as such. I generally stash only when I need to touch something away for a few minutes, and then apply when I'm done looking at something.
https://git-scm.com/docs/git-stash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With