git rollback code version in several ways

Git commit to a rollback Code

Rollback command:
git the RESET --hard the HEAD ^ fall back to the previous version

git reset --hard HEAD ~ 3 times before submitting the first three to fall back, and so on, until the following n submit retreated back

git reset --hard commit_id retreated to / into, (rollback will be submitted before or after the submission) specified commit hash code

Here Insert Picture Description

After submitting the rollback may fail, you must be forced to submit

:( strong push to the remote may need to be addressed to protect the state of the corresponding branch)
git the Push the HEAD Origin --force

Reply attention [information], free access to information architecture, video, as well as curated face questions
! [Insert Picture description here] (https://img-blog.csdnimg.cn/20200114155136352.jpg?x-oss-process = image / watermark, type_ZmFuZ3poZW5naGVpdGk, shadow_10 , text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3hpbnpoaWZ1MQ ==, size_16, color_FFFFFF, t_70

Focus on micro-channel public number: [something] in the programmer, Re: [data] 200G free access to learning materials, containing a selection of face questions, SSM, Spring family bucket, micro-services, MySQL, MyCat, clusters, distributed, middle pieces, Linux, network, multi-threaded, Jenkins, Nexus, Docker, ELK and so free learning videos, continuously updated!

Published 58 original articles · won praise 40 · views 120 000 +

Guess you like

Origin blog.csdn.net/xinzhifu1/article/details/92770108