KeenGamer .com
KeenGamer .com

Reputation: 11

Recovering deleted folder by GIT

I was stashing my code changes and GIT deleted my ignored folder /img/*, is there any way to recover the ignored folder?

Thanks a lot for answering!

Upvotes: 0

Views: 259

Answers (2)

Bharadwaj Yarlagadda
Bharadwaj Yarlagadda

Reputation: 61

First of all git doesn't delete any of your stuff. I am guessing you have done the following:

  1. Create a folder and add some stuff into the folder
  2. Now, you want to stash the changes you have made and you have run git stash.
  3. git stash helps you in stashing the changes which you have recently made.
  4. So, that means it stashed the recent folder creation (which is a change)
  5. Now, if you do git stash pop you will get back the changes which means you will see your folder again.

Upvotes: 0

Luke Glazebrook
Luke Glazebrook

Reputation: 580

You can unstash the last stashed set of changes by running the following: git stash pop.

If the files were removed as part of the stash process then that should get them back for you.

I have a hunch though that they didn't get deleted by the stash. Stashes by default, without any flags, will leave ignored files alone.

Upvotes: 1

Related Questions