How to restore shelved changes in Intellij when the shelf tab is not shown?

I tried to use the “shelf” feature for the first time in IntelliJ IDEA today. I shelved all my current changes so that I could work on a quick bugfix, commit it, and come back to my current work afterwards.

When I commited the “shelf” action, IntelliJ created the shelf and I could see it in the tool window. Then it reverted, and reloaded the project.

  • In git, what are some good conventions to format multiple comments to a single commit
  • git-svn clone error: error: there are still refs under 'refs/remotes/tags'
  • How can I see incoming commits in git?
  • Which DVCS work best with Subversion repositories
  • Branching in Mercurial
  • Merges between two branches in two directions - any good reason or completely forbid?
  • Now the shelf tab in the Changes tool window does not appear any more.

    However in the file system I can see the patch file under .idea/shelf.

    Why ? I suspect the problem is that the .idea directory is itself under version control. So when I shelved the changes, it file was included in the shelved changes, and then it was reverted, and IntelliJ is not aware of the shelved changes any more.

    I am using Git.

    How can I make IntelliJ aware of the patch file in the change tool window ? Or if impossible how can I restore these changes based on the patch file only ?

    And how to use this feature in the future without encountering this problem ?

    Is it a bad practice to keep the .idea directory in te VCS ?

  • Extract authorship information from git repository
  • Android Studio git check in author name
  • After git push heroku - uploaded files on Heroku are lost
  • git: why exactly is the claim “git is based on differences between files” wrong?
  • How to efficiently rebase and push a local git branch?
  • GIT SSH public key error
  • One Solution collect form web for “How to restore shelved changes in Intellij when the shelf tab is not shown?”

    The answer to the

    How can I make IntelliJ aware of the patch file in the change tool
    window ?

    question was :

    1. Create a bogus shelved change so that the “shelf” tab is available. It will not show if there are currently no shelved changes.

    2. Right click in the “shelf” tab, select “import patch file”, pick the previously create patch file. This creates the “shelf”

    3. You can now “unshelf” the changes normally

    Finally, I had to manually merge the workspace.xml file. After this, I think I will think about stopping to commit IDE project files to VCS. At least when it is a trivial task to recreate the IDE project from e.g. a checked out Maven project.

    Git Baby is a git and github fan, let's start git clone.