Bitpath

Lesson 1 · Unit 03

Reset, restore, revert

Which of the three trees does each undo move?

13 exercisesabout 3 min

What you practise

  • git restore for files, git reset --soft/--mixed/--hard as "which trees move", git revert to undo in public, commit --amend

Try a question from this lesson

Pick one

A branch is a pointer to its newest commit. You regret the last commit and have not shared it. What is the simplest way git could undo it?

The idea

Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.

Concept

Three resets

git reset <commit> moves the current branch to that commit. The option decides how far the change reaches.

Soft stops at the branch: your work stays staged. Mixed (the default) also resets the index: your work stays in the files, unstaged. Hard also overwrites the files: the work is gone.

          branch  index   files
--soft    moves   -       -
--mixed   moves   resets  -
--hard    moves   resets  resets

11 more exercises in the app

  • 2× multiple choice
  • 4× type the answer
  • 2× fill the blanks
  • 1× true or false
  • 1× order the lines
  • 1× match the pairs

Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.

One email when Bitpath is ready to try. Nothing else. Privacy