Git - Sample Interview Question (Junior Level)

Assume that you have the following situation, where Z is your HEAD and (A) is the state of your files.

       (A)
X-Y-Z
         |
    master

What will happen if you run the following command

git reset --hard HEAD~1

  1. X will be the HEAD and Z will still be accessible
  2. X will be the HEAD and Z will be removed permanently
  3. Y will be the HEAD and Z will still be accessible
  4. Y will be the HEAD and Z will be removed permanently
Tests in Git for Juniors

Test Name Difficulty Time (minutes) No. of Questions
Git Online Test for Juniors Git Junior 20 10