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

From: Pratyush Yadav <[email-masked]>
Date: Wed, 28 Oct 2020 18:37:17 +0530

On Tue, Oct 27 2020, Filipp Bakanov wrote:

> 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.

Why do you need to Google when `git status` tells you how to do it?

    $ touch foo
    $ git add foo
    $ git status
    On branch master
    Your branch is up to date with 'origin/master'.

    Changes to be committed:
      (use "git restore --staged <file>..." to unstage)
    	new file:   foo
    
    $ git restore --staged foo
    $ git status
    On branch master
    Your branch is up to date with 'origin/master'.

    Untracked files:
      (use "git add <file>..." to include in what will be committed)
    	foo

    nothing added to commit but untracked files present (use "git add" to track)

-- 
Regards,
Pratyush Yadav