harbor run -t LiteCoder/recover-lost-git-commitsharbor download LiteCoder/recover-lost-git-commitsA Git repository at /app has suffered a mistaken force push that reset the main branch back to its very first state, losing 7 important commits. The lost commits are still reachable via git reflog. Your job is to recover all lost commits, restore them to the main branch, clean up the repository, and document the recovery.
Identify lost commits: Use git reflog to find all 7 commits that were lost after the force-push reset.
Create a recovery branch: Create a branch named exactly recovery that points to the commit containing all the lost work (i.e., the state before the reset).
Restore main branch: Merge or otherwise restore the main branch so that it contains all recovered commits. After recovery, main must include the full history with all 7 lost commits. The main branch must be the checked-out branch when done.
Verify recovered files: After recovery, the following files must exist in the working tree at /app:
README.mdsrc/config.pysrc/utils.pyapp.pymodels/database.pyapi/routes.pyrequirements.txttests/__init__.pytests/test_utils.pyClean up dangling references: Run garbage collection or prune to clean up any dangling objects in the repository.
Document the recovery: Create a file at /app/recovery.log that documents the recovery process. This file must contain:
reflog (indicating the tool used for discovery)recovery (referencing the recovery branch)merge or reset (indicating how commits were restored)Commit the log: The recovery.log file must be committed to the main branch.
When complete, the repository should satisfy:
mainrecovery existsgit log --oneline main shows at least 8 commits (the original commits plus any recovery/merge commits)recovery.log exists and is tracked by Git