简体   繁体   中英

Accidentally deleted untracked files with a git push

I made a funky mistake.

In the command line, I moved a bunch of files from an untracked git directory /temp/ to a tracked git directory /httpdocs/assets/trackeddirectory/new_folder/(lots of files). I did this a few months ago and totally forgot about it...

When I checked git status, I didn't see this or think much of it.

When I did a git push, it erased this complete /new_folder/ that was transferred. Since it was never tracked via git, there is no record of the /new_folder/full_of_files in git. They are just gone.

Hosting on ubuntu / amazon was. I'm waiting on my devop to see if he can help but was wondering if anyone had a solution to something like this?

I tried:

sudo debugfs -w /dev/sda1 debugfs 1.42.13 (17-May-2015) /dev/sda1: No such file or directory while opening filesystem

And it doesn't seem to work for me. I must be using the wrong path?

I found the solution...

My devopp replaced the production server with a new instance while investigating an issue and didn't tell me about it (site is related to sports and dead at the moment while sports are out so this is fine). When doing so, the new instance was created based on what was tracked in git.

Luckily, my old instance still has the files and was simply not being referenced.

hahahah.. Yay:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM