0

I have never asked anything here, but there is a first time for everything.

What happened?

Recently I did a dumb mistake of not committing my project for 6 days straight to my github branch. Worked only locally. After deploying the project to firebase hosting, I decided to to commit to my branch, but instead I switched the branch, did not move the files and then did the fetch. GitHub took out all my locally saved files and did a fetch of 6 days old commit. I did not set-up firebase with github as well, so I lost all my files.

What did I try

  • I searched my macbook Bin And found bunch of different javascript files, but none that matched the ones github took out.
  • I tried restoring guthub HEAD but no luck there.
  • I tried retrieving deleted files with software like DiskDrill, but nothing as well.
  • Finally I found that I have I have a lots of .json files under /node_modules/.cache/babel-loader.

Screenshot from project

Most of them are weird generated scripts, but in some of them I can clearly see the path to my files but I am guessing they are babel compiled enter image description here

Any ideas how I can retrieve that cache as a files?

Reinis
  • 1
  • 1
  • 2
    I don't believe git allows you to switch branches if you have uncommited changes, do you remember exactly how you switched branches? Did you switch by force, did you stash the changes, or did you commit the changes locally? – Chris Hamilton Nov 09 '22 at 02:34
  • Check if you also have source-map files. That might help in re-generating the source files? – vighnesh153 Nov 09 '22 at 02:36

1 Answers1

-1

Here is how you can fetch your lost files from firebase by running a script.

npx https://gist.github.com/mbleigh/9c8680cf319ace2f506f57380da66e7d <site_name>

Your files were stored on firebase's vcs when you deployed your project, so firebase has them. And here is a similar question

Marat
  • 618
  • 1
  • 6
  • 10