]> git.ipfire.org Git - thirdparty/git.git/blobdiff - Documentation/git.txt
Merge branch 'nd/switch-and-restore'
[thirdparty/git.git] / Documentation / git.txt
index f9b09db89b83b9be12c4fdce856b4be822db23f0..e095514ace357b8e76ab0d9ea58b2a6c0e3dcd5b 100644 (file)
@@ -211,6 +211,26 @@ people via patch over e-mail.
 
 include::cmds-foreignscminterface.txt[]
 
+Reset, restore and revert
+~~~~~~~~~~~~~~~~~~~~~~~~~
+There are three commands with similar names: `git reset`,
+`git restore` and `git revert`.
+
+* linkgit:git-revert[1] is about making a new commit that reverts the
+  changes made by other commits.
+
+* linkgit:git-restore[1] is about restoring files in the working tree
+  from either the index or another commit. This command does not
+  update your branch. The command can also be used to restore files in
+  the index from another commit.
+
+* linkgit:git-reset[1] is about updating your branch, moving the tip
+  in order to add or remove commits from the branch. This operation
+  changes the commit history.
++
+`git reset` can also be used to restore the index, overlapping with
+`git restore`.
+
 
 Low-level commands (plumbing)
 -----------------------------