Re: Set the repository as it was on an earlier commit
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Dec 26, 2009, 14:28 UTC
- Message-ID
- <vpqiqbt95e7.fsf@bauges.imag.fr>
- In-Reply-To
- <adf1fd3d0912251536kbf25272ob0ab8ee90e53861d@mail.gmail.com>
Santi Béjar <santi@agolina.net> writes:
Show 7 quoted lines
> 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
I guess
(at the root of the repo)
git checkout B -- . # git status if you want to check. git commit
does this. The "-- ." part of "git checkout" asks Git to checkout the files, but the path limiter prevents it from updating HEAD, so the HEAD still points to the tip of the branch.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/