Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
417 views
in Technique[技术] by (71.8m points)

repository - can i restore a .git file after rm-rf?

I needed to pull the master branch but was having issues merging it into my local master and so thought it expeditious to simply rm -rf the entire folder. This was the greatest error of my life to date because I had weeks of work in an unpushed local branch commited in my .git. Can someone please tell me there's some way of finding and restoring this?? If it makes a difference, I'm on a Windows machine.

Thanks all.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Alright, so all hope is apparently lost for my git history (the .git file that I foolishly obliterated) -- HOWEVER! All hope has not ultimately been lost because following the sage advice of Lincoln Spector, I was able to recover all of my deleted working directories, most of which were in their most current state, and the rest of which (and I'm still incredibly grateful for these) were just a couple of days out of date. Recuva Portable, which was just one strategy recommended there, has just saved me several days of work and several million strands of hair.

Thanks for all the answers. I'm just throwing this in because the best I got told me to use System Recovery/Windows Backup/restore points of some form or another which would have been great if only I'd been using those features prophylactically. Alas, I was not. So I had to go the dirty route. So if anyone is smart enough to have already been using those features, by all means go the routes offered in the other answers, especially by Tone. If anyone is like me and failed both in the past and present, Recuva worked great.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...