Files lost from Github repository

34 views Asked by At

I have a Github repository where I made an initial commit, but never made any commits afterwards. I made a bunch of changes, added a bunch of files, and then made a new branch. From that branch, I deleted a few files and realized that I deleted a file that I didn't mean to - I tried pressing ctrl z a couple times to undo the deletion, but it didn't work. I then tried going back to my main branch, but the files weren't there anymore. There were only a few empty folders left and my node_modules folders (which seemed untouched). 20+ files that I was working on all disappeared, and I'm not sure how I can recover them.

This is my git reflog:

    32cd20c (HEAD -> mvp, main, build) HEAD@{0}: checkout: moving from main to mvp
    32cd20c (HEAD -> mvp, main, build) HEAD@{1}: checkout: moving from build to main
    32cd20c (HEAD -> mvp, main, build) HEAD@{2}: checkout: moving from main to build
    32cd20c (HEAD -> mvp, main, build) HEAD@{3}: checkout: moving from mvp to main
    32cd20c (HEAD -> mvp, main, build) HEAD@{4}: checkout: moving from main to mvp
    32cd20c (HEAD -> mvp, main, build) HEAD@{5}: checkout: moving from build to main
    32cd20c (HEAD -> mvp, main, build) HEAD@{6}: reset: moving to HEAD
    32cd20c (HEAD -> mvp, main, build) HEAD@{7}: checkout: moving from main to build
    32cd20c (HEAD -> mvp, main, build) HEAD@{8}: commit (initial): Initial commit

I believe it's somewhere near the reset: moving to HEAD where all of the files disappeared.

Yes, I'm dumb for not committing any changes during this process.

Any help would truly be appreciated. Happy to provide any more information.

I tried pressing control z in the folder, and it didn't work. I also tried switching back to the main branch, but it seems like the files have disappeared there, too.

0

There are 0 answers