Subject: Re: Proposal: "unadd" command / alias.

From: "Theodore Y. Ts'o" <[email-masked]>
Date: Tue, 27 Oct 2020 17:56:38 -0400

On Tue, Oct 27, 2020 at 01:32:50PM -0700, Junio C Hamano wrote:
> Filipp Bakanov <[email-masked]> writes:
> 
> > Hi! I suggest to add "unadd" command, that will undo a git add command.
> >
> > git unadd path/to/file
> >
> > It will be an alias to:
> >
> > git reset HEAD -- path/to/file
> >
> > The motivation is that I always forget syntax and have to google each
> > time I want to undo accidentally added files. Unadd is just much
> > easier to remember and quite obvious.
> 
> The alias is for you to do the above, I think.

Filipp,

Indeed, I have a similar alias in my ~/.gitconfig

[alias]
	revert-file = checkout HEAD --

Adding

[alias]
	unadd = reset HEAD --

to your .gitconfig would do what you want.  As a BTW, my favorite
alias is:

   lgt = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit

Sample usage: "git lgt origin.." or "git lgt -10".

Cheers,

					- Ted