【Git+Source Tree使用教程之四】Reset

Reset

Here is our current repo:

initial_repo.png 

With the Book has the following:

Annabel Lee
BY EDGAR ALLAN POE 1809-1849
Published in 1849
Update A
Update B
Update C

But we don't like the updates A, B, and C. So, we want to forget them and back to 691923c commit which was for the "added birth & death" commit.

Double click on that commit, then we get the following menu:

initial_repo.png 

Select "Reset master to this commit":

SureDialog.png 

It is set to the default reset (see previous tutorial on Mixed Reset - Default), we have additional type of resets (Soft Reset - (git reset --soft <SHA key>) or Hard Reset - (git reset --hard <SHA key>)) as shown in the picture below:

Soft_Mixed_Hard.png 

If we choose the default reset, we can keep the working copy. So, the Book1 in our working directory looks like this, and it's uncommited status:

Annabel Lee
BY EDGAR ALLAN POE 1809-1849
Published in 1849
Update A
Update B
Update C

The graph should look like this:

AfterResetGraph.png 


原文鏈接:http://www.bogotobogo.com/cplusplus/Git/Git_GitHub_Source_Tree_4_Reset.php

發佈了106 篇原創文章 · 獲贊 24 · 訪問量 132萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章