记录一次GIT本地丢失文件的恢复

90 阅读1分钟

合并冲突的时候不小心删除了本地未提交文件

解决过程

1 缓存区恢复文件

find .git/objects -type f | xargs ls -lt | sed 10q

//  /7a/dcf6cb091817f990c75cadd1a2de8816f19613

git show 7adcf6cb091817f990c75cadd1a2de8816f19613 > 1.txt

2 太多了,查看其他更好的方式

git reflog show --date=iso

找到提交的痕迹恢复