简体   繁体   中英

Git - Restore lost commits

As the team I'm on has grown, we have seen a number of situations where commits get lost due to merge mistakes.

We are working on the educational aspect already, but when this happens, what are some of the best ways in git to restore the lost commits - I've heard of using commands like git bisect and manually checking out each commit. What else is out there to help?

看起来您需要git fsck --lost-found

git reflog可用于找出不再在任何分支上但尚未进行gc处理的提交的提交哈希。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM