git reset

git-reset - Reset current HEAD to the specified
state

git reset [] []

This form resets the current branch head to
and possibly updates the index (resetting
it to the tree of ) and the working tree
depending on . Before the operation,
ORIG_HEAD is set to the tip of the current branch.
If is omitted, defaults to —mixed. The
must be one of the following:

—soft
Does not touch the index file or the working tree
at all (but resets the head to , just like
all modes do). This leaves all your changed files
”Changes to be committed”, as git status would put
it.

—mixed Resets the index but not the working tree (i.e.,
the changed files are preserved but not marked for
commit) and reports what has not been updated.
This is the default action.

—hard Resets the index and working tree. Any changes to
tracked files in the working tree since
are discarded. Any untracked files or directories
in the way of writing any tracked files are simply
deleted.

—merge
—keep