Interview Prep/Git & GitHub/Recovery and incident handling

How do you restore a file's deleted history after a repo migration lost it?

IntermediateProductionRecovery and incident handling
Answer

<details> <summary><b>Answer</b></summary>

If the old repo exists, fetch from it as a second remote and graft or use git replace --graft to link histories, or add the old repo as an archive reference in README. If it is gone, rebuild from backups or mirrors.

All Git & GitHub questions Roadmap: Git & GitHub

More on Recovery and incident handling