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

  • SEARCH
  • Home
  • 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 8306219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:17:10+00:00 2026-06-08T18:17:10+00:00

I have a bad feeling my work is lost. Is there a way to

  • 0

I have a bad feeling my work is lost. Is there a way to possibly get them back?

Here’s a gist of what I did:

# Initially
$ git init -q
$ echo foo >foo
$ git add foo
$ git commit -m initial
[master (root-commit) 399ac4f] initial
 1 file changed, 1 insertion(+)
 create mode 100644 foo

# Work work work
$ rm foo
$ mkdir foo && echo bar >foo/bar

# This is where things went bad
$ git stash
Saved working directory and index state WIP on master: 399ac4f initial
HEAD is now at 399ac4f initial
$ git stash pop
Removing foo
# On branch master
# ...
no changes added to commit (use "git add" and/or "git commit -a")
Dropped refs/stash@{0} (c8353a2223b73ceb9aa73fac64829919b68c86e9)

# What happened to my work!?
$ find foo
find: foo: No such file or directory

$ git --version
git version 1.7.11.3

Unfortulately, I don’t think foo/bar ever saw the repository/index, as I hadn’t run any git commands on it prior to this.

  • 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-08T18:17:11+00:00Added an answer on June 8, 2026 at 6:17 pm

    You can easily recover the lost stash (you can see its revision on the screen). But it is no use.

    git stash does not save new files (foo/ directory content in your case), but it does git reset --hard before exit. And that restores the working directory which effectively removes foo/.

    I suggest using some kind of deleted files recovering tool.

    P.S. Sent an email about this into git mailing list. They said it is a bug, because git stash is intended to be a safe command. But for now just use git stash -u. This way git saves to the stash all (even untracked) files

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

Sidebar

Related Questions

I have a string such as big bad dog, how can I get an
I have a bad feeling that the answer is no, but is the checkin
I have a bad feeling that the answer to this question is no, but
I really am feeling bad. I have one web application that sends Emails for
i hat one task, and know i have to continue but have a bad
I need help getting git extensions to run with msysgit. I have had bad
Unfortunately I have a pretty bad understanding of how to properly set up threading.
I become use raw socket and i have this problem: bad file descriptor the
I have clients with really bad networks, including bad mappings at the gateways and
Is it bad practice to have a custom cursor on a website? Not just

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.