首页 > 解决方案 > 需要恢复桌面文件 - 使用 Git Bash 意外删除的桌面目录

问题描述

我是 Git 新手,我做了一些愚蠢的事情。

我从 GitHub 分叉了一个存储库,然后使用 Git Bash 将其克隆到我的计算机上。长话短说,我希望该目录在我的桌面上,但由于某种原因,我使用了rm -r Desktop,现在我所有的桌面文件都不见了。

然后我将回购克隆到我的桌面,这是我在那里唯一的东西。我尝试关闭 Git Bash,因为我没有提交任何更改,但我的文件仍然不见了,我不确定该怎么做。

如何恢复我的桌面文件?我没有提交或推动或做任何这种性质的事情,所以我认为这些更改仍然是本地的。在此先感谢您的帮助!

标签: bashgitgithubrepositoryrestore

解决方案


TestDisk is a tool for recovering files which have been deleted.

  1. Install testdisk
  2. nter testisk into the command line, and the utility will start.
  3. Select your partition to search in.
  4. Select quick search or deeper search.
  5. testdisk will output which files have been recovered and then you can decide to recover or not.

A tutorial on testdisk at the following link, https://www.journaldev.com/36700/how-to-install-testdisk-on-linux-and-recover-deleted-files


推荐阅读