Git help Document Reading Notes-Chapter 2-Section 3

Source: Internet
Author: User

Undo operation 1. last modification submitted

Sometimes, after we submit the file, we find that a few files are missing, or the submitted information is wrong. You can use-- AmendOption resubmit:

$ Git commit -- Amend

If you directly run this command, you will have the opportunity to re-edit the submission instructions, but the file snapshot to be submitted is the same as the previous one.

If you forget to save some modifications when submitting the file, you can first add the temporary operation and then run it.-- AmendSubmit

$ Git commit-m'initial commit'

$ Git add forgotten_file

$ Git commit -- Amend

The preceding three commands generate only one commit, and the second commit command fixes the first commit content.

2. Cancel saved files

How to cancel files in the temporary storage area

In fact,Git statusThe command output tells us how to do it.

Git reset head <File>...Cancel temporary storage

Cancel modified files in the working directory

Git statusThe specific Undo method is also prompted.

$ Git checkout -- benchmarks. Rb

 

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.