我可以在rm-rf之后还原.git文件吗? [英] can i restore a .git file after rm-rf?

查看:127
本文介绍了我可以在rm-rf之后还原.git文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要拉出master分支,但是在将其合并到本地master时遇到了问题,因此认为简单地将rm -rf整个文件夹简化是很迅速的.这是迄今为止我一生中最大的错误,因为我在.git中提交的未推送本地分支中工作了数周.有人可以告诉我,有一些方法可以找到并恢复它吗?如果有帮助,那么我在Windows计算机上.

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.

谢谢.

推荐答案

好了,所以对于我的git历史记录(我愚蠢地删除了.git文件),所有希望显然都荡然无存了-但是!并没有完全放弃所有希望,因为遵循了 Recuva Portable (在这里推荐的一种策略)刚刚为我节省了几天的工作和几百万根头发.

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.

感谢所有答案.我之所以这么说是因为,我最好的方法是告诉我使用某种形式的System Recovery/Windows备份/还原点,如果仅预防性地使用这些功能,那将是很好的选择.las,我不是.所以我不得不走这条肮脏的路.因此,如果有人足够聪明,已经在使用这些功能,则一定要走其他答案中提供的路线,尤其是 Tone .如果有人像我一样在过去和现在都失败了,那么 Recuva 会表现出色.

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.

这篇关于我可以在rm-rf之后还原.git文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆