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.

  • Benefits of using git branches vs. multiple repositories
  • How can I convert a Git repository with branches to a workable Mercurial repository?
  • preserving history when using mercurial ontop of clearcase
  • How does Mercurial stack up against GIT and SVN?
  • Delete remote repository from git shell
  • What is a practical workflow for keeping local changes uncommited in git?
  • 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 ?

  • How to detect whether a Git server supports shallow cloning?
  • PhoneGap “git” command line tool is not installed
  • How to merge a branch into another branch in Git while maintaing the old lines?
  • How to push on GitHub from Visual Studio 2010?
  • git pull is failing with error: cannot fork() for git-upload-pack
  • git merge confict with .class file
  • 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.