git revert overwrite submit _git

Source: Internet
Author: User

Tutorial 3 overwrite submission. 2. Revert

To save time, this tutorial uses existing history as the local database.

Download from here

We will use the revert command to cancel the "Add pull Tutorial" submission.

First enter the Stepup-tutorial/tutorial2 directory. The status of the local side's history is shown in the following figure.

Confirm History with log command

$ git log
commit 0d4a808c26908cd5fe4b6294a00150342d1a58be
author:yourname <yourname@yourmail.com>
Date:   Mon June 23:19:26 +0900

    Add pull description

commit 9a54fd4dd22dbe22dd966581bc78e83f16cee1d7
author:yourname <yourname@yourmail.com>
Date:   Mon June 23:19:01 +0900

    Add a description of the commit

326fc9f70d022afdd31b0072dbbae003783d77ed
author:yourname <yourname@yourmail.com>
Date:   Mon June 23:17:56 +0900

    Add the description of the add to

commit 48eec1ddf73a7fb508ef664efd6b3d873631742f
author:yourname <yourname@yourmail.com>
Date:   Mon June 23:16:14 +0900

    

Open the Sample.txt file and confirm the contents.

Even the monkeys know it. Git command
Add change entry into the index
the status of the commit record index
pull get the content of the remote database

Use revert to cancel the "Add pull Tutorial" submission.

$ git revert head
[master d47bb1d] revert "add pull description"
 1 files changed, 1 insertions (+), 2 deletions (-)

Open the Sample.txt file to see if the pull's description disappears, indicating that the cancellation was successful.

Confirm History with log command

$ git log
commit 7bcf5e3b6fc47e875ec226ce2b13a53df73cf626
author:yourname <yourname@yourmail.com>
Date:   Wed June 15:46:28 +0900

    Revert "Instructions for adding pull" This

    reverts commit 0d4a808c26908cd5fe4b6294a00150342d1a58be.

Commit 0d4a808c26908cd5fe4b6294a00150342d1a58be
Author:yourname <yourname@yourmail.com>
Date:   Mon 23:19:26 +0900

    Add a description

of Pull Commit 9a54fd4dd22dbe22dd966581bc78e83f16cee1d7
author:yourname <yourname@yourmail.com>
Date:   Mon June 23:19:01 +0900

    Add a description of a commit

commit 326fc9f70d022afdd31b0072dbbae003783d77ed
Author:yourname <yourname@yourmail.com>
Date:   Mon 23:17:56 +0900

    Add a note

Commit 48eec1ddf73a7fb508ef664efd6b3d873631742f
author:yourname <yourname@yourmail.com>
Date:   Mon June 23:16:14 +0900

    
From:http://backlogtool.com/git-guide/cn/stepup/stepup7_2.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.