Differences between git revert and git Reset

Source: Internet
Author: User

Git revert-N INDEX

 

Differences between git revert and git Reset 
1. Git revert is the commit before rolling back and forth with a new commit. Git reset is to delete the specified commit directly.
2. In the rollback operation, the effect is similar. However, there are differences between the previous versions of merge in the future. Because git revert uses a reverse commit before commit "neutralization", this change will not occur again when old branch is merged in the future, however, git reset deletes some commit on a certain branch. Therefore, when the old branch and the old branch run merge again, these rollback commit should also be introduced.
3. git reset moves the head backward, while git revert moves forward with the head, but the content of the new commit is exactly the opposite of the content to be revert, which can offset the content to be revert.

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.