I regret having applied a stash (wrong branch). How can I undo this and have my stash back to my stash list in order to apply it later on the right branch?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you haven’t committed, you should just be able to
git stashagain, possibly with agit reset HEADfirst.Also,
git stash applydoesn’t delete the stash likegit stash popdoes. So if you have committed, you couldgit reset --hard [last_good_commit](if you haven’t pushed) orgit revert [last_good_commit](if you have pushed) and just apply the stash again once you’re on the right branch.Note: Running
git reset --hardwill delete any uncommitted code.