GIT deletes a specified version submission

Original address: https://www.jeremyjone.com/451/ , please indicate if reprinting.

Sometimes the wrong submission, or wrong submission, but after resubmission, the wrong submission version still exists, then you need to delete the specified historical version, the specific operation is as follows:

git log  // 获取提交信息
git rebase -i (commit-id)  // commit-id 为提交版本的hash code

   
    
    
  • 1
  • 2

Note: There is a pit here. Commit-id is the previous hash code that needs to be deleted.

file

After using the command, open a file, change the pick in front of the version that needs to be deleted to drop, and illustrate with a picture:

file

Save and close after modification, ZZor :wqvim commands are not repeated here.

After exiting, use git logto check again, you can see that the corresponding version is gone.


For more commands, see: git command

                                </div>
            <link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-60ecaf1f42.css" rel="stylesheet">
                            </div>

Original address: https://www.jeremyjone.com/451/ , please indicate if reprinting.

Sometimes the wrong submission, or wrong submission, but after resubmission, the wrong submission version still exists, then you need to delete the specified historical version, the specific operation is as follows:

git log  // 获取提交信息
git rebase -i (commit-id)  // commit-id 为提交版本的hash code

   
  
  
  • 1
  • 2

Note: There is a pit here. Commit-id is the previous hash code that needs to be deleted.

file

After using the command, open a file, change the pick in front of the version that needs to be deleted to drop, and illustrate with a picture:

file

Save and close after modification, ZZor :wqvim commands are not repeated here.

After exiting, use git logto check again, you can see that the corresponding version is gone.


For more commands, see: git command

                                </div>
            <link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-60ecaf1f42.css" rel="stylesheet">
                            </div>

Guess you like

Origin blog.csdn.net/My_Way666/article/details/106625940