Re: Set the repository as it was on an earlier commit
- From
- Santi Béjar <santi@agolina.net>
- Date
- Dec 25, 2009, 23:36 UTC
- Message-ID
- <adf1fd3d0912251536kbf25272ob0ab8ee90e53861d@mail.gmail.com>
- In-Reply-To
- <8c6f7f450912251509i67da4665t78be0bb79f2c40d6@mail.gmail.com>
On Sat, Dec 26, 2009 at 12:09 AM, Sergio Belkin <sebelk@gmail.com> wrote:
Show 20 quoted lines
> Hi, > > Firstly merry Christmas everyone. > > I am somewhat new to git, and I've found great, but still I have some > doubts about it, let's say I have the following repo with: > > A---B---C---D > > Being A the first commit, B the second one an D the last one. > > How I do to go back to let's say... B commit status, I mean somewhat as follows: > > A---B---C---D---B' > > B' would be the same as B. I am not asking to do something so: > > A---B---C---D to A---B losing C and D commits, > > I'd like to keep on history C and D commits, can git to do that?
I don't know if it is possible with porcelain commands, but with plumbing you can:
# begin with a clean working dir git read-tree B git commit git reset --hard
HTH, Santi