FrontendDeveloper.in

Git Track Detail

How do you recover a deleted file from history?

Locate a commit containing the file and restore it using git restore --source=<commit> <file> or git checkout <commit> -- <file>.