Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8083637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:32:12+00:00 2026-06-05T17:32:12+00:00

I frequently use git stash and git stash pop to save and restore changes

  • 0

I frequently use “git stash” and “git stash pop” to save and restore changes in my working tree. This is what I did and my previous uncommitted changes now are gone.

git stash -u
git checkout master
git pull --rebase
git checkout dev
git merge --no-ff master
10 files changed, 1000 insertions(+), 2000 deletions(-)
git stash pop 
CONFLICT (content): Merge conflict in file.ext

Then I thought I could revert the merge, and I did:

git reset --hard origin/master
git reset --hard origin/master

Now I don’t see any of my previous stashed uncommitted changes anywhere in file.ext, only the merged code. How can I bring back all the changes that I originally stashed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:32:14+00:00Added an answer on June 5, 2026 at 5:32 pm

    When you pop off the stash, it removes it from the stash as well. So the stashed changes were dumped back into your working directory. Then, when you reset, you reverted those same changes.

    git reset --hard is one of the few dangerous “you-could-totally-lose-work-here” commands. This explains the different aspects of reset really well.

    To sum up, they aren’t in the stash anymore, and you reset the working directory. So they were most likely lost to the ether of bits and bytes. Though since those changes were once stashed, you may be able to find the commit with git fsck --lost-found.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I frequently use git stash and git stash pop to save and restore changes
I use cast() from the reshape package quite frequently. Almost every time, this warning
I frequently find myself creating classes which use this form (A): abstract class Animal
I'm a working with eclipse in Ubuntu. In eclipse, i frequently use a shortcut
I have a program i frequently use that is made with .NET. This program
I frequently use HTML output in applications, up to now I've used some simple
I'm working on a music related website, and frequently use the HTML special characters
I frequently use git 'guerrilla-style' by nesting a git repo inside a Subversion, Perforce
I frequently use this CSS selector parent>child. My design looks good in Mozilla and
I frequently use sorted and groupby to find duplicates items in an iterable. Now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.