社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Git

如果我提交的存储库或分支不再存在,如何在git中恢复已删除的文件

curtis Arrisol • 4 年前 • 1863 次点击  

请帮助我,我已经为此工作了一段时间了!!!!

所以我在做一个项目,我开始和 githubDesktop (我真的很好奇)并最终删除了一个存储库。起初我没有意识到这一点,但当我打开项目文件夹时,我的大部分文件都不见了,我只能看到几个月前最后一次提交的文件。我不知道这是否与分支有关,但这表明我目前处于领先地位。

当我运行ls时,它会显示我删除的所有文件。(不知怎的,是误会了)

PS C:\Users\curti\Desktop\MFLS> ls                                             


    Directory: C:\Users\curti\Desktop\MFLS


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        20/03/2022     10:23                .idea
d-----        04/03/2022     15:03                django-csp
d-----        20/03/2022     09:55                media
d-----        20/03/2022     09:56                MFLS
d-----        20/03/2022     09:56                MFLS_main
d-----        20/03/2022     09:56                registration
-a----        12/03/2022     17:53         180224 db.sqlite3
-a----        11/01/2022     14:01            682 manage.py
-a----        15/01/2022     07:56            164 Pipfile
-a----        15/01/2022     07:56           4819 Pipfile.lock

像这样,但我试图找到这是做了,我不能,我也找不到任何承诺,至少接近今天,这将有帮助,但我不能它只显示我从其他项目的旧承诺。当我运行git log--diff filter=D--summary时,我得到如下结果:

PS C:\Users\curti\Desktop\MFLS> git log --diff-filter=D --summary
warning: refname 'HEAD' is ambiguous.
warning: refname 'HEAD' is ambiguous.
commit 828d61868e0601152849bef2575c0b4142d51a0e
Author: Curtis Arissol <curtisarissol286@gmail.com>
Date:   Wed Aug 4 11:44:03 2021 +0400

    having problem with task or to-do bar but partially completed and working

 delete mode 100644 classy/index.js
 delete mode 100644 classy/views/index.js

commit 8cf9c230ad49a3712151ff109b978bb3288257cd (checking-old-auth)
Author: Curtis Arissol <curtisarissol286@gmail.com>
:
 ...and other old commits.

注意:我第一次使用github桌面时丢失了我的文件,我尝试去github。com和恢复存储库(即使我不确定这是问题所在),但我不能。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/132513
文章 [ 1 ]  |  最新文章 4 年前