Advanced exercises

Overview

Teaching: 0 min
Exercises: 0 min
Questions
  • Can I stretch myself gitwise?

Objectives
  • Try out some resets

Optional advanced exercises

These are advanced exercises. Absolutely no problem to postpone them to few months later.

They make use of the following commands:

$ git reset --hard <branch/hash>  # rewind current branch to <branch/hash>
                                  # and throw away all later code changes
$ git reset --soft <branch/hash>  # rewind current branch to <branch/hash>
                                  # but keep all later code changes and stage them
$ git rebase <branch/hash>        # cut current branch off and transplant it on top of <branch/hash>
$ git reflog                      # show me a log of past hashes I have visited
$ git checkout -b <branch/hash>   # create a branch pointing to <branch/hash>

Key Points