Subject: Re: On git 1.6 (novice's opinion)

From: Etienne Vallette d'Osia <[email-masked]>
Date: Fri, 27 Mar 2009 11:57:45 +0100

Ulrich Windl a écrit :
>>> 3) "git undo": If possible undo the effects of the last command.
> 
> If impossible, add confirmations for some "dangerous" (non-obvious) commands 
> before doing possibly harmful things. Maybe adding a kind of "user-level setting" 
> (novice, expert, guro) could control such confirmations.
> 
Why ?
All objects stored are immutable, and some tools keep informations 
(ORIGIN_HEAD, refs/original) to allow a undo hand-made.
Moreover the reflog (and stash if you want to use it for this use) store 
  informations during time...

So it's possible to provide a generic undo for all commands that change 
refs.

Maybe an "undo" directory in $GIT_DIR, which will a keep a copy version 
of all refs. Every commands store the current refs in this folder _before_
to change anything, and the undo restore them all.
At least, a "lastcmd" (for example) file could be added in this 
directory to allow an more clever undo.