报错
error: The following untracked working tree files would be overwritten by checkout
git clean -d -fx
但是千万慎用,用之前备份一下项目代码,特别是项目中不跟踪提交的有用的脚本与配置文件等
这个命令会
1.-x 删除忽略文件已经对git来说不识别的文件
2. -d 删除未被添加到git的路径中的文件
3. -f 强制删除
这个删除之后,回收站不会有, 很难找回来
心痛呀!
提前安装vscode (local History) by xyz 不知道能不能恢复
git文档说明
Cleaning your Working Directory
Finally, you may not want to stash some work or files in your working directory, but simply get rid of them; that’s what the git clean command is for.
Some common reasons for cleaning your working directory might be to remove cruft that has been generated by merges or external tools or to remove build artifacts in order to run a clean build.
You’ll want to be pretty careful with this command, since it’s designed to remove files from your workin