Skill 2.2.5

Recover specific data by using Git commands

Key Concepts

git reflog records where HEAD pointed, which allows a commit lost through a reset or rebase to be found. git branch recovered SHA then restores it. git fsck --lost-found finds dangling commits.

git restore --source=SHA -- path recovers one file from an earlier commit, git revert undoes a commit with a new commit, and git cherry-pick copies a commit. git log --diff-filter=D -- path shows when a file was deleted.