Unstage All Files In Git

In order to commit files, they are staged. The addition can be done in different ways but the most popular command is git add --all which adds all unstaged files into the index by staging them. All files can be unstaged in different ways which are explained in detail below.

Unstage All Files

The git reset command can be used to unstage all files easily. There is no need to add extra parameters or options.

$ git reset

List Unstaged Files

After unstaging all files the unstaged files can be listed with the git status command.

$ git status

Unstage Multiple Files

The git reset command can be used unstage multiple files easily. The syntax to unstage multiple files is like below.

git reset -- FILE1 FILE2 ... FILEN

In the following example, we unstage multiple files named “dev.c”, “scan.c” and “help.c”.

$ git reset -- dev.c scan.c help.c

Leave a Comment