恢复永久删除的文件夹 - git项目

发布于 2025-01-24 13:50:33 字数 288 浏览 1 评论 0原文

我在工作的Git上结帐了一个特定的分支。 每次我进行一些更改时,我都会使用命令来推动并推动它们:

git push origin HEAD:master

今天,我删除了我从桌面上进行的项目,并试图用最后一个代码再次克隆回购。

当我访问仓库时,我意识到我要推动的所有工作都没有投入。有没有办法找到这些文件或从我的桌面恢复永久删除的文件?

我测试了一些工具(例如Stellar,recuva,磁盘钻,Windows File Recovery,Imyfone),没有成功:(

I had checkout a specific branch on git where I was working.
Each time I made some changes, I committed and push them using the command:

git push origin HEAD:master

Today, I deleted the project I was working on from my desktop and tried to clone again the repo with the last code.

When I visited my repo I realized that all the work I was pushing using the command above was not committed. Is there a way to find these files or recover permanently deleted files from my desktop?

I tested some tools (e.g. Stellar, Recuva, Disk Drill, Windows File Recovery, imyfone) without success :(

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

川水往事 2025-01-31 13:50:34

好的,事实证明(从您的评论中),当您推动时,您从服务器中拒绝了更新消息。好吧,当遥控器告诉您更新被拒绝时,这是一条消息,说您尝试推动的承诺实际上是从本地存储库推出到远程存储库。

因此,本地存储库是唯一的位置。而且,由于您已删除了本地存储库,因此它们根本不存在。

Okay, so it turns out (from a comment of yours) that when you pushed, you got the Updates were rejected message from the server. Well, when the remote told you that the updates were rejected, that was a message saying that the commits you tried to push were not actually pushed from the local repo to remote repo.

So the local repo was the only place where these commits existed. And since you deleted the local repo, they don't exist at all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文