1. 程式人生 > >【Git+Source Tree使用教程之四】Reset

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

Reset

Here is our current repo:

initial_repo.png

With the Book has the following:

AnnabelLee
BY EDGAR ALLAN POE 1809-1849Publishedin1849Update 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

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:

AnnabelLee
BY EDGAR ALLAN POE 1809-1849Publishedin1849Update A
Update B
Update C

The graph should look like this:

AfterResetGraph.png