33

When I switch branch with non-committed changes I'm given a prompt to stash my changes:

enter image description here

When I switch back to the branch with the stashed changes I can't see any of the non-committed changes.

Using EGit how can I retrieve the stashed changes?

robinst
  • 30,027
  • 10
  • 102
  • 108
Edd
  • 8,402
  • 14
  • 47
  • 73

2 Answers2

51

EGit 3.5 and later

In EGit 3.5 and later, there is a menu called Stashes in the Team context menu. It provides an action to stash changes and also lists any existing stashes. The same menu is also available as a toolbar icon and in the Git Repositories view:

stash menu

Selecting an existing stash from the menu opens it in a viewer. The changes can be inspected and there are actions for applying the stash or deleting it:

stash viewer

EGit 3.4 and ealier

  1. Open the Git Repositories view (Ctrl+3 and typing, Cmd+3 on Mac OS X)
  2. Expand the node of the corresponding repository
  3. Expand the Stashed Commits node
  4. Open the context menu of the stash and select Apply Stashed Changes
robinst
  • 30,027
  • 10
  • 102
  • 108
3

In Eclipse (Luna) + eGIT, you can restore stash as enter image description here

Yogesh Manware
  • 1,843
  • 1
  • 22
  • 25
  • I see in this screenshot the item to stash changes, but NOT to pop (i.e., apply) stashed changes. I see the same in Eclipse Mars + EGit. What view, what item, what context menu (or whatever) allows applying (i.e., popping) a stashed change set? – chrisinmtown Jun 26 '15 at 17:33
  • 3
    To apply the stashed changes, goto Git Repository View and expand relevant repository node, there you would see the node "Stashed Commits". – Yogesh Manware Jun 29 '15 at 09:08
  • Looks like there was a contest: "How to best hide a standard feature"! And wehn you try to unstash something you get a nice "conflict" dialog which makes it impossible to unstash it. Furthermore in the stash view you can compare files but not export any patch. Which idiot has designed this UI - GIT integration in Eclipse is next to useless! – Robert Apr 12 '19 at 16:14
  • I did not have much of an issue with this, clicked on checkout, files appeared in "Staged Changes" and I pulled them back up to the unstaged changes. All restored. Then deleted the stash commit. – xamid Oct 06 '20 at 08:14