0
0
Gitdevops~10 mins

Recovering deleted branches 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 list all recent commits including deleted branches.

Git
git reflog [1]
Drag options to blanks, or click blank then click option'
A--all
B--deleted
C--branches
D--show
Attempts:
3 left
💡 Hint
Common Mistakes
Using --branches does not show deleted branches.
Using --deleted is not a valid git reflog option.
2fill in blank
medium

Complete the command to create a new branch from a commit hash.

Git
git branch [1] <commit-hash>
Drag options to blanks, or click blank then click option'
A<branch-name>
B-d
C-m
D--force
Attempts:
3 left
💡 Hint
Common Mistakes
Using -d deletes a branch instead of creating one.
Using -m renames a branch, not creates.
3fill in blank
hard

Fix the error in the command to checkout a recovered branch.

Git
git [1] <branch-name>
Drag options to blanks, or click blank then click option'
Abranch
Bcommit
Ccheckout
Dmerge
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' tries to create a commit, not switch branches.
Using 'branch' lists or creates branches but does not switch.
4fill in blank
hard

Fill both blanks to create and switch to a new branch from a commit hash.

Git
git [1] -b [2] <commit-hash>
Drag options to blanks, or click blank then click option'
Acheckout
Bbranch
Cnew-branch
Dreset
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'branch' with -b is invalid.
Using 'reset' does not create a branch.
5fill in blank
hard

Fill all three blanks to recover a deleted branch by finding the commit hash, creating the branch, and switching to it.

Git
git reflog [1] && git branch [2] [3] && git checkout [2]
Drag options to blanks, or click blank then click option'
A--all
B<branch-name>
C<commit-hash>
D--deleted
Attempts:
3 left
💡 Hint
Common Mistakes
Using --deleted is not a valid reflog option.
Mixing up branch name and commit hash positions.