git pull - 如何取消删除本地文件 [英] git pull - how to un-delete local files

查看:1067
本文介绍了git pull - 如何取消删除本地文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



场景:


  1. 我有一个文件夹中的本地文件
  2. 我从服务器执行git init
  3. git pull https:// ..

  4. 删除所有本地文件



  5. 我可以删除已删除的文件吗? p>

    谢谢

    解决方案

    是没有办法使用git恢复他们。在这一点上,你唯一能做的就是使用为你的操作系统编写的第三方取消删除工具来恢复它们。



    (在我的测试中,git不会删除本地文件在一个 git pull ,但是现在如何被删除的文件与问题无关,只有git的声望不会被删除用户数据。)


    How to un-delete / recover local files from git pull?

    Scenario:

    1. I have local files in a folder
    2. I do git init
    3. "git pull https://.." from server
    4. All the local files is deleted

    Can I get my deleted files back?

    Thanks

    解决方案

    If the lost files were never staged or committed, there is no way to restore them using git. At this point, the only thing you can do is try to restore them using third-party undeletion utilities written for your OS.

    (In my tests git doesn't delete local files at a git pull, but at this point how the files got deleted is not relevant to the question, only to git's reputation for not deleting user data.)

    这篇关于git pull - 如何取消删除本地文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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