Tutorial 3 overwrites the submission. 3. Reset
To save time, this tutorial uses the existing history as a local database.
Download from here
We will use reset to remove the first two commits from the Master branch.
First enter the Stepup-tutorial/tutorial3 directory. The status of the local side history is shown in the following figure.
Confirm the history with the log command.
$ git log
commit 0d4a808c26908cd5fe4b6294a00150342d1a58be
author:yourname <yourname@yourmail.com>
Date: Mon Jul 23:19:26 +0900 Add pull
instructions
commit 9a54fd4dd22dbe22dd966581bc78e83f16cee1d7
author:yourname <yourname@yourmail.com>
Date: Mon Jul 23:19:01 +0900
Add a description of the commit
commit 326fc9f70d022afdd31b0072dbbae003783d77ed
author:yourname <yourname@yourmail.com>
Date: Mon Jul 23:17:56 +0900
Add the instructions for adding add
commit 48eec1ddf73a7fb508ef664efd6b3d873631742f
author:yourname <yourname@yourmail.com>
Date: Mon Jul 23:16:14 +0900 First
Commit
Open the Sample.txt file to confirm the content.
Even a monkey knows. git command
add changes input to the index status of the
commit record index to
get the contents of the remote database
Delete the submission with reset.
$ git reset--hard head~~
HEAD is now at 326fc9f add description
Open the Sample.txt and see if "Add a Commit" and "add pull" are gone. or use the log command to confirm the history.
$ git log
commit 326fc9f70d022afdd31b0072dbbae003783d77ed
author:yourname <yourname@yourmail.com>
Date: Mon Jul 23:17:56 +0900
Add the instructions for adding add
commit 48eec1ddf73a7fb508ef664efd6b3d873631742f
author:yourname <yourname@yourmail.com>
Date: Mon Jul 23:16:14 +0900 First
Commit
Submissions prior to reset can be referenced by Orig_head. When reset is wrong, reset on Orig_head can be restored to the state before reset.
$ git reset--hard orig_head
HEAD is now at 0d4a808 Add pull description
From:http://backlogtool.com/git-guide/cn/stepup/stepup7_3.html