@git / git-reference / commits / 5f02769

Improve explanation on reset --hard.

Niels Bom committed Aug 17, 2015 at 11:43 UTC 5f027691f60696fe54ab6c93143f1c06162eae07
1 file changed +7 -6
basic/index.html
+7 -6
@@ -724,12 +724,13 @@ nothing to commit (working directory clean)
724 <small>unstage files AND undo any changes in the working directory since last commit</small>
725 </h4>
726
727 - <p>The third option is to go <code>--hard</code> and make your working
728 - directory look like the index, unstage files and undo any changes made
729 - since the last commit.
730 - This is the most dangerous option and not working directory safe. Any
731 - changes that are not in the index or that have not been committed will be lost.</p>
732 -
727 + <p>The third option is to go <code>--hard</code>. This command discards your staged changes and
728 + the changes in your working directory. In other words: it resets your staging area and working
729 + directory to the state they were in right after the given commit. This is the most
730 + dangerous option and is not working directory safe. Any changes not committed will
731 + be lost.
732 + </p>
733 +
734 <pre>
735 <b>$ git status</b>
736 # On branch master