harbor run -t LiteCoder/recover-lost-commits-reflogharbor download LiteCoder/recover-lost-commits-reflogYou are a developer who accidentally lost commits and branches. Use git reflog and related commands to recover them. All work is done inside /app.
/app.main.txt with the content initial commit and commit it with the message Initial commit.second line to main.txt and commit with the message Add second line.third line to main.txt and commit with the message Add third line.feature.feature.txt with the content feature work 1 and commit with the message Feature commit 1.feature work 2 to feature.txt and commit with the message Feature commit 2.feature work 3 to feature.txt and commit with the message Feature commit 3.feature branch, perform a hard reset back 2 commits (to Feature commit 1), simulating accidental deletion of the last two feature commits.git reflog to identify the lost commits, then recover the branch back to the state of Feature commit 3 (i.e., the feature branch tip should again point to the commit with message Feature commit 3). After recovery, feature.txt must contain exactly:
feature work 1
feature work 2
feature work 3
main (or master, whichever is the default branch).bugfix.bugfix.txt with the content critical fix and commit with the message Bugfix commit.main/master and delete the bugfix branch (force delete with -D).bugfix branch using reflog so that a branch named bugfix exists again, pointing to the commit with message Bugfix commit. The file bugfix.txt must contain exactly critical fix.recovered-feature pointing to the commit with message Feature commit 3.recovered-bugfix pointing to the commit with message Bugfix commit./app/RECOVERY.md that documents the recovery process. It must contain all three of the following keywords (case-insensitive): reflog, reset, checkout.After all steps, the repository at /app must satisfy:
feature and bugfix both exist.recovered-feature and recovered-bugfix both exist.feature branch, feature.txt has 3 lines: feature work 1, feature work 2, feature work 3.bugfix branch, bugfix.txt contains critical fix./app/RECOVERY.md exists and contains the words reflog, reset, and checkout.feature branch contains commits with messages: Feature commit 1, Feature commit 2, Feature commit 3.bugfix branch contains a commit with message Bugfix commit.