Re: Reverting an uncommitted revert
- From
Jeff King <peff@peff.net>
- Date
- May 20, 2009, 16:58 UTC
- Message-ID
- <20090520165854.GA23031@coredump.intra.peff.net>
- In-Reply-To
- <fabb9a1e0905200913u5252973aia9a20983b20243d3@mail.gmail.com>
On Wed, May 20, 2009 at 06:13:55PM +0200, Sverre Rabbelier wrote:
Show 7 quoted lines
> On that note, the usefulness of such a feature is dependant on the > support we have for actually restoring an entry from this new reflog. > The current reflog is so amazingly useful because git has > awesome-cherry-pick-and-the-like-commit-handling powers that make it > easy to restore the otherwise lost state. But as far as I know, > there's no nice 'n easy support for restoring state to the information > contained in this new reflog, is there?
I was envisioning a reflog of tree objects, so you could do:
$ git reflog show TRASH ;# show the reflog message
$ git show TRASH@{1} ;# show what's in the tree
$ git show TRASH@{1}:path/to/file ;# see a file
$ git checkout TRASH@{1} path/to/file ;# restore a filewhich should all work as-is.
I suspect "git log -g" might need some tweaking to get a tree rather than a commit (but in theory we should just show the "Reflog *:" headers and not the commit headers).
-Peff