1

I'm pretty new with GIT and i accidentally (not really) deleted a bunch of local files while trying to recover changes from the repository, i have a frontend branch where i work and i make the following in order to bring back some changes:

git fetch origin
git reset --hard origin/frontend

Is there any way to recover the files that I lost because of this? I know there's a lot of threads about recovering files out there but since I'm a newbie I really want to have feedback on this specific case. Any help will be REALLY appreciated.

Important Update: Before doing all of this I commit all my changes (that included the files that I lost) to the repository, that's why I thought that I will get the same thing when I did the fetch origin, I have tried to list my commits but I'm not seeing this last commit.

Lowtrux
  • 156
  • 2
  • 12
  • 41

1 Answers1

0

I just posting this in order to answer my question (already answered by @RomainValeri and @MohammedAneesA in the comments).

I was able to solve this by getting all my commits with "git reflog" I got my last commit hash and then did a "reset head -- hard "

That solved it.

Lowtrux
  • 156
  • 2
  • 12
  • 41