0
0
Gitdevops~10 mins

Reflog for finding lost commits in Git - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to show the reflog entries.

Git
git [1]
Drag options to blanks, or click blank then click option'
Areflog
Bbranch
Clog
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git log' instead of 'git reflog' to find lost commits.
2fill in blank
medium

Complete the command to reset the current branch to a lost commit found in reflog.

Git
git reset --hard [1]
Drag options to blanks, or click blank then click option'
AHEAD~2
Borigin/main
CHEAD@{3}
Dmaster
Attempts:
3 left
💡 Hint
Common Mistakes
Using branch names like 'master' or 'origin/main' instead of reflog references.
3fill in blank
hard

Fix the error in the command to show reflog with commit hashes and messages.

Git
git reflog [1] --oneline
Drag options to blanks, or click blank then click option'
A--graph
B--pretty=oneline
C--format=oneline
D--decorate
Attempts:
3 left
💡 Hint
Common Mistakes
Using --format without --pretty or using unrelated options.
4fill in blank
hard

Fill both blanks to create a command that shows reflog entries with timestamps and author info.

Git
git reflog [1] [2]
Drag options to blanks, or click blank then click option'
A--pretty=format:'%h %ad %an %s'
B--oneline
C--date=iso
D--graph
Attempts:
3 left
💡 Hint
Common Mistakes
Using --oneline which lacks detailed info.
Mixing up date formatting options.
5fill in blank
hard

Fill all three blanks to create a command that recovers a lost commit by creating a new branch at that commit.

Git
git branch [1] [2] && git checkout [3]
Drag options to blanks, or click blank then click option'
Arecovered-branch
BHEAD@{5}
Dmaster
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'master' instead of the new branch name for checkout.
Not using reflog syntax for the commit.