- 输入命令
git fsck --lost-found
,显示如下内容:
Checking object directories: 100% (256/256), done.
dangling commit c358cc7ce8699310247c72562b218cc7e21310a3
...
- 复制上面显示的
id
号,输入git show c358cc7ce8699310247c72562b218cc7e21310a3
,显示:
commit c358cc7ce8699310247c72562b218cc7e21310a3
Merge: 01de2a4 7f06056
Author: soojade <soojade@sina.com>
Date: Tue Jan 21 10:48:17 2020 +0800
WIP on dev: 01de2a4 修改404
diff --cc src/views/error-page/404.vue
index 52effc6,52effc6..28028f4
--- a/src/views/error-page/404.vue
+++ b/src/views/error-page/404.vue
...
- 看好要恢复的内容,执行
git merge c358cc7ce8699310247c72562b218cc7e21310a3
,显示:
Updating 01de2a4..c358cc7
Fast-forward
src/views/error-page/404.vue | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
...
至此,删除的文件就会被合并到上次的提交中。