简体   繁体   中英

On sourcetree, how can I recover stashes after checkout on a different branch?

I had some stashed changes while I was working on a branch.

I wanted to work locally on a different branch so I did checkout into a new branch and lost all the stashes from sourcetree sidebar.

Here is a screenshot of sourcetree:

源树

If I type git stash list on my terminal I get a list of the stashes...

stash@{0}: On feature/SITE-5-doctor-name-at-checkin-success: Before commits
stash@{1}: WIP on feature/SITE-5-doctor-name-at-checkin-success: df48232 WIP show dummyDoctor on success page
stash@{2}: WIP on feature/SITE-5-doctor-name-at-checkin-success: 82b1aed Linting
stash@{3}: On feature/SITE-5-doctor-name-at-checkin-success: DEBUG

...so I know they are not lost.

How do I get them back to my sourcetree sidebar so I can use them in any of those branches?

Welcome to Stack Overflow :)

Stashes are indeed listed in the sidebar, but in your image they're collapsed. The 'Show' links next to Tags, Remotes, Stashes, etc only show on hover.

Note that trying to apply a stash from one branch to another branch may result in conflicts to resolve. In this case, sourcetree will not delete your stash automatically, as it would usually, rather you'll need to right click and 'delete' stashes once you've successfully applied them.

单击箭头,单击“Stashes”一词不会打开下拉菜单

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM