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?
To retrieve changes out of the stash and apply them to the current branch you're on, you have two options: git stash apply STASH-NAME applies the changes and leaves a copy in the stash. git stash pop STASH-NAME applies the changes and removes the files from the stash.
Stashing Your Work Having a clean working directory and applying it on the same branch aren't necessary to successfully apply a stash. You can save a stash on one branch, switch to another branch later, and try to reapply the changes.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With