Git back to the previous version command

Source: Internet
Author: User
Git's return to the previous version of the command gitreset is to reset the content of the current head without leaving log information. GitresetHEADfilename removes the file gitreset -- hardHEAD ~ from the temporary storage area ~ 3. all the latest three submissions will be reset, just as if they were not submitted. Git... git return to the previous version. The git reset command resets the content of the current head without leaving log information. Git reset HEAD filename remove the file git reset -- hard HEAD ~ from the temporary storage area ~ 3. all the latest three submissions will be reset, just as if they were not submitted. Git reset -- hard commit (batch) is rolled back to 38679ed709fd0a3767b79b93d0fba5bb8dd235f8 based on -- soft -- mixed -- hard, the working tree, index, and HEAD are reset: git reset -- mixed: this is the default mode. git reset without any parameters is used. in this way, it is rolled back to a specific version, only the source code is retained, and the commit and index information is rolled back to git reset -- soft: to a specific version, only the commit information is rolled back, and the data is not restored to the index file level. If you want to submit it, you can directly commit git reset -- hard: to completely roll back to a specific version, and the local source code will also change to the content of the previous version, for example: I want to completely return the previous version. Git reset -- hrad HEAD ~ 1. I want to go back to the last submitted version: git reset -- hard

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.