October 2016
Beginner
861 pages
20h 37m
English
In this example, we'll learn how we can undo a commit as if it had never happened. We'll learn how we can use the reset command to effectively discard the commit and thereby reset our branch to the desired state.
In this example, we'll use the example of the hello world repository, clone the repository, and change your working directory to the cloned one:
$ git clone https://github.com/dvaske/hello_world_cookbook.git $ cd hello_world_cookbook
First, we'll try to undo the latest commit in the repository as though it never happened:
$ git status On branch master Your branch ...