Recovery, backup và disaster recovery
Phục hồi thao tác sai khác với phục hồi mất storage; reflog, fsck, bundle và mirror có phạm vi khác nhau.
Local recovery
Sau reset/rebase/delete branch, dừng GC, kiểm reflog --all, tạo branch cứu hộ tại commit đúng. Nếu reflog thiếu, git fsck --lost-found tìm dangling objects rồi inspect bằng show. Không prune trước khi điều tra.
Integrity và corruption
git fsck --full kiểm object connectivity/integrity nhưng không biết business correctness. Với clone có remote tin cậy, quarantining repo và fresh clone thường an toàn hơn sửa tay. Giữ logs, xác định blast radius và rotate credential nếu nghi compromise.
DR design
Mirror clone sao chép refs hiện có nhưng deletion có thể replicate; không thay immutable backup. git bundle tạo artifact offline có prerequisite rõ và verify được. Backup phải gồm Git refs/objects, LFS, server config/hooks/permissions và key material theo policy. Diễn tập restore và đo RPO/RTO.