Recover Removed Shelved Code in Android Studio

I didn’t commit my code for 2 days, I don’t know why I didn’t do it 😁

I had to rebase my branch, so I shelved my code as always …
There was some conflict btw my local and remote, I did a lot of things… that I don’t remember now :D

When my branch was updated and I wanted to unshelve, I realized my shelve is empty 0_o I completely forgot about it.

To recover my changes, I’ve found a tiny/sweet but savior solution.

We just have to find “ShelveName”.patch and import it to android studio.

You can find the patch here :

My Project Directory/.idea/shelf/”Shelvename”/shelved.patch

and then apply the patch, VCS Menu -> Import Patch

In this step, you have to decide to import it to your workspace or shelve it.

That’s all 🤞

--

--

Android Developer 5+

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store