Getting ready

Again, we'll use the hello world repository. If you make a fresh clone, make sure to run the scripts for this chapter so that there will be some entries in the reflog command.

The scripts can be found on the book's home page. If you just reset the master branch to origin/master after performing the recipes in this chapter, everything will be ready.

We can create a fresh clone as follows:

$ git clone https://github.com/PacktPublishing/Git-Version-Control-Cookbook-Second-Edition_hello_world_cookbook.git
$ cd Git-Version-Control-Cookbook-Second-Edition_hello_world_cookbook

We can reset an existing clone as follows:

$ cd Git-Version-Control-Cookbook-Second-Edition_hello_world_cookbook$ git checkout master $ git reset --hard origin/master ...

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.