IDE : IntelliJ
I just clicked on the "clear" in the unstash window by mistake and lost a huge stash.
Is there any way to get them back?
(Why is the question getting voted down when none of the solutions that people suggested helped me to recover from my problem. Is one suppose to ask only pedantic and pedagogical questions? )
There are two ways to restore work from the stash: Using git stash pop - The command restores the changes and schedules the stash for deletion. Using git stash apply - The command restores the changes but doesn't delete the stash from the ref.
From the main menu, choose Git | Uncommitted Changes | Unstash Changes. Select the Git root where you want to apply a stash, and make sure that the correct branch is checked out. Select the stash you want to apply from the list. If you want to check which files are affected in the selected stash, click View.
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.
To reapply our stashed changes at a later point, we can use git stash apply . We can apply the stash entry to a different branch – it doesn't have to be the branch that we created the stash from.
I lost the stash. But since I was using IntelliJ all through for coding, it kept local history of all the file for almost 1 week.
How I recovered my files using IntelliJ? http://www.jetbrains.com/idea/webhelp/viewing-local-history-of-a-file-or-folder.html#
After that I created a patch (right click on file and time when you thought your changes were stashed) and carefully selected only those files that were modified by me.
Now apply the patch and you are good to go.
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