gpt4 book ai didi

java - 我可以重新导入已删除的 .git 文件而不丢失代码吗?

转载 作者:行者123 更新时间:2023-12-02 01:16:14 25 4
gpt4 key购买 nike

我从项目中删除了 .git 文件。但是,我还没有删除我的项目文件夹。我仍然可以仅导入 .git 文件而不重新导入整个项目吗?

我还没有尝试过任何不想在删除文件夹并重新导入完整项目时丢失代码的操作

最佳答案

要从系统中恢复文件/文件夹,您需要寻找一些恢复工具

但以下是一些步骤,您可以如何安全地保存未投入的精力:

1- clone your project into another folder.

2- you will have the latest code with .git stuffs.

3- copy paste all files from old folder to new.

4- now you have overwritten only those files which are having change.

5- run git status to see the efforts intact.

或者:

1- clone your project into another folder.

2- you will have the latest code with .git stuffs.

3- copy paste all .git stuffs from new folder to older.

4- now you have git back into your project.

5- run git status to see the efforts intact.

关于java - 我可以重新导入已删除的 .git 文件而不丢失代码吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58516295/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com