Git Study Notes (2)

Source: Internet
Author: User

What I learned this time isVersion rollback

 

Basic commands:

  1. View submitted git logs
  2. Version rollback git Reset
  3. View git reflog for each command

 

 

Procedure:

  • Commit scripts to readme.txt and submit them to the GIT repository.

,

 

Readme.txt has three versions in git:

The order of submission time is as follows:

First: wrote a readme.txt

Second: Add distrubuted

Third: add difficulties

  • If there are too many versions, you can only view the history by using the GIT log command.

A major string after commit consisting of digits and letters is the version number.

  • In git, head indicates the current version, head ^ indicates the previous version, head ^ indicates the previous version, and head ^ indicates the previous version ~ 10.

Roll back to the previous version of git reset -- hard head ^

Return to the third version: add difficulties

Git reset -- hard a1ac5da5b345f2f0eada06b534bde4108c1b73c4 (the version number can be left blank, just the first few digits)

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.