Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I unshelve changes

I found myself accidentally making changes in the wrong branch before I checked anything in. I tried to switch branch and it told me I couldn't because I had outstanding changes. I read that I could shelve changes, switch branch and then retrieve those changes on the correct branch.

I have done the first two steps but now can't find a way to actually unshelve the changes. I can't find anything in menus either in the toolbar or context menus. I've looked in the .hg/attic directory and I can see the changes stored there so I know that its not that they don't exist.

3 answers

1 accepted

8 votes
Answer accepted

In the left panel of your repository, (not counting bookmarks, if you're on windows), you should see expandable lists for "File Status", "Branches", "Tags", "Remotes", and "Stashes" ("Shelves"). Some of the terminology may be slightly different, because I use Git, not Mercurial.

You should be able to expand Shelves, and right click a shelf to apply/delete.

Ah yes. I can see it now. I'd totally missed that thing (it was collapsed by default so didn't really impinge on my vision). Thanks very much! As it is I have mannually redone things for now but it will be massively useful for the future. :)

How did you do the shelving?

I cannot speak for mercurial but for git only - I think the procedure is called "stashing" in git

  • Select the modified files you want to be shelved (stashed)
  • Press the "Stash" button in the toolbar. You will be asked for a symbolic name for the stash/shelve
  • All the selected modified files will be put into the stash with the given name
  • You'll see the stash in sourcetree's view, were tags and branches are located ("Stashes")
  • Switch to your desired branch
  • Right click on your stash
  • "Apply Stash" ....
  • .... and you are done. After successful applying the stash you might want to remove it ...

Using Sourcetree 1.3.3 on Windows.

Hope that helps

Wrote the answer simultanously ... :-)

That is very helpful but sadly just a bit slower than Seth. I did indeed stash as you suggested but hadn't really understood how it worked so was just expecting a similar "unstash" button somewhere to click on. What you say makes perfect sense now and will make me more efficient with sourcetree now. :)

I figured. I'm on stackoverflow a lot where this looks like it comes from and am very used to the whole simultaneous answers thing. ;-)

For newbies, there is a Hide/Show option when you mouseover each category, e.g.BRANCHES, BOOKMARKS, ..., SHELVED.  You may need to hide some other list and show the desired list.

If you don't see the hide/show options, try expanding the sidebar to make it wider. These links are apparently only shown if there is room.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

4,318 views 4 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you