Backlog uses cookies to deliver our services. By visiting our website, you agree to the use of cookies as described in our Cookie Policy.

For this tutorial step, we have prepared a repository with some ready made commits to speed things up.

You can download the repository here.

We are going to undo the "append description of the pull command" commit using the "revert" command.

Go to the downloaded "stepup-tutorial/tutorial2" directory and examine the history of this repository. It should look like the following.

Current history

Examine the history log using the log command.

$ git log commit 0d4a808c26908cd5fe4b6294a00150342d1a58be Author: yourname <yourname@yourmail.com> Date: Mon Jul 16 23:19:26 2012 +0900 append description of the pull command commit 9a54fd4dd22dbe22dd966581bc78e83f16cee1d7 Author: yourname <yourname@yourmail.com> Date: Mon Jul 16 23:19:01 2012 +0900 append description of the commit command commit 326fc9f70d022afdd31b0072dbbae003783d77ed Author: yourname <yourname@yourmail.com> Date: Mon Jul 16 23:17:56 2012 +0900 append description of the add command commit 48eec1ddf73a7fb508ef664efd6b3d873631742f Author: yourname <yourname@yourmail.com> Date: Mon Jul 16 23:16:14 2012 +0900 first commit

Open the sample.txt file and verify its content.

Git commands even a monkey can understand add: Register a change in an index commit: Save the status of an index pull: Obtain the content of the remote repository

Let's undo the latest HEAD commit titled "append description of the pull command" using the revert command.

$ git revert HEAD [master d47bb1d] Revert "append description of the pull command" 1 files changed, 1 insertions(+), 2 deletions(-)

Open sample.txt. If the above procedure has been done correctly, the last line "pull: Obtain the content of the remote repository" should no longer exist.

The history of repository after the revert.

You can confirm the new history log using the "log" command.

$ git log commit 7bcf5e3b6fc47e875ec226ce2b13a53df73cf626 Author: yourname <yourname@yourmail.com> Date: Wed Jul 18 15:46:28 2012 +0900 Revert "append description of the pull command" This reverts commit 0d4a808c26908cd5fe4b6294a00150342d1a58be. commit 0d4a808c26908cd5fe4b6294a00150342d1a58be Author: yourname <yourname@yourmail.com> Date: Mon Jul 16 23:19:26 2012 +0900 append description of the pull command commit 9a54fd4dd22dbe22dd966581bc78e83f16cee1d7 Author: yourname <yourname@yourmail.com> Date: Mon Jul 16 23:19:01 2012 +0900 append description of the commit command commit 326fc9f70d022afdd31b0072dbbae003783d77ed Author: yourname <yourname@yourmail.com> Date: Mon Jul 16 23:17:56 2012 +0900 append description of the add command commit 48eec1ddf73a7fb508ef664efd6b3d873631742f Author: yourname <yourname@yourmail.com> Date: Mon Jul 16 23:16:14 2012 +0900 first commit