Information Technology Reference
In-Depth Information
soft
,
--mixed
,
--hard
that influence its behavior. Their meaning is summarized
in
Table 8-1
.
influences
HEAD
and the staging area. The third option (
--hard
) influences all three
snapshots:
HEAD
, the staging area, and the working directory.
The operation we already know quite well is:
$ git reset --hard [REVISION]
The internals of this operation can be described as:
• Modification of
HEAD
: update the
HEAD
so that it points to the
[REVISION]
• Modificationofthestagingarea:takethesnapshotsothatitisnowpointed
by the
HEAD
and store it in the staging area
• Modification of the working directory: take the snapshot now pointed by
the
HEAD
and check it out into the working directory
After the command all three snapshots are exactly the same. Your current revision is
[REVISION]
. Be careful: this command modifies the working directory. As you
already know you will lose uncommitted changes!
The second option,
--mixed
is default. Thus both the following commands are
identical:
$ git reset --mixed [REVISION]
$ git reset [REVISION]