Git stash command disappeared with files

Asked

Viewed 583 times

1

I was working on an important update in the company’s system and needed to solve another problem, so I put the changes I made in stash to change branch and lower the master more updated to solve this other problem.

To my sadness when I circled the stash, he didn’t add some updates that were in my folder vendor. He actually created the blank folder, but there are no files.

Does anyone know if they have how to recover my files?

Note: I had not given any commit for these updates I’ve made.

  • Unfortunately no friend, maybe your IDE’s history might have something.

  • I think I’ll give up anyway. I searched and couldn’t find a solution. What puzzles me is that git has disappeared with important files and I don’t know what was the cause.

  • You already use git reflog to try to understand what happened?

  • @Lucasrivoiro Voce may have pulled or reset without committing the files, it is common this kind of confusion =/

  • @egomesbrandao I used the reflog but found nothing there. however I understood my mistake. I will put as answer. Hugs!

  • @Felipepaetzold Worse than that wasn’t the problem.

Show 1 more comment

1 answer

1


I have come to put an end because there was no way to recover the files. But I understood the problem and I will explain so that no one makes the same mistake I did.

As I said, I was editing a folder that was in vendor and that folder was downloaded using commiserate from a repository Git. I needed to edit it but she had another folder .git who ended up conflicting and not leaving mine git see the changes I made in the class. Then I re-read some changes and deleted the folder .git and then I could realize stash or even give commit be lose my updates.

  • 1

    It is never enough to remember that the folder vendor It’s just for third-party files, so it’s usually ignored in GIT (so it doesn’t get the same code twice). If you need to change something there you better make one fork of the project repository and change in the composer.json for him to use your copy. So you get control - but tb is responsible for the update. Delete the folder .git will only cause you not to receive updates from the original developer, which may make your code unsafe in the future.

  • Thanks for the tip, buddy! I’m new to git and I don’t know much about Poser yet. I’ll give you a look at what you said. Hugs!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.