Again, we'll use the hello world repository. If you make a fresh clone, make sure to run the scripts for this chapter (04_undo_dirty.sh), so there will be some objects for git fsck to consider. The scripts can be found on the book's home page. If you just reset the master branch after performing the other recipes in the chapter, everything will be ready.
We can create the 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
HEAD is now at 3061dc6 Adds Java version of 'hello world'