此问题已在此处有答案:
Recover from losing uncommitted changes by "git reset --hard"(23答案)
Recovering added/staged file after doing git reset --hard HEAD^?(6个答案)
Undo git reset --hard with uncommitted files in the staging area(13个回答)
In Git, how can I recover a staged file that was reverted prior to committing?(3个答案)
昨天关门了。
是否有机会恢复在此命令之前未提交的文件?我使用了这个命令而不是--soft....我正在编写Linux/Visual Studio代码
035e859 HEAD@{23}: reset: moving to HEAD~1
3704540 HEAD@{24}: commit: [TA-4] Creating a form onf Frontend that allows you to add TodoList
035e859 HEAD@{25}: commit: [TA-4] Creating a Controller that supports adding TodoList
5b1623d HEAD@{26}: commit: [TA-4] Project Configuration
c77dcb0 HEAD@{27}: commit: [TA-4] Adding Api Platform To the Project
字符串
我尝试使用git reset --hard HEAD@{23}
命令,但不幸的是,我没有取回未提交的文件。
1条答案
按热度按时间byqmnocz1#
如果你从未提交过想要恢复的文件,那么任何git命令都无法恢复它们。除非你有其他的支援,否则恐怕你运气不好。Visual Studio Code的local history可能能够帮助您,但我对它不够熟悉,无法提出任何具体建议。