summaryrefslogtreecommitdiff
path: root/Documentation/git.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-09 22:25:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-09 22:25:44 (GMT)
commitf496b064fc1135e0dded7f93d85d72eb0b302c22 (patch)
tree2149d0faf99c67ddd76a6d68125037f661db48a5 /Documentation/git.txt
parentb49d337bfbdd431697161244ff7b2241d9887c9f (diff)
parent97ed685701a6df0273f7d29fd5bc0a0658a63cad (diff)
downloadgit-f496b064fc1135e0dded7f93d85d72eb0b302c22.zip
git-f496b064fc1135e0dded7f93d85d72eb0b302c22.tar.gz
git-f496b064fc1135e0dded7f93d85d72eb0b302c22.tar.bz2
Merge branch 'nd/switch-and-restore'
Two new commands "git switch" and "git restore" are introduced to split "checking out a branch to work on advancing its history" and "checking out paths out of the index and/or a tree-ish to work on advancing the current history" out of the single "git checkout" command. * nd/switch-and-restore: (46 commits) completion: disable dwim on "git switch -d" switch: allow to switch in the middle of bisect t2027: use test_must_be_empty Declare both git-switch and git-restore experimental help: move git-diff and git-reset to different groups doc: promote "git restore" user-manual.txt: prefer 'merge --abort' over 'reset --hard' completion: support restore t: add tests for restore restore: support --patch restore: replace --force with --ignore-unmerged restore: default to --source=HEAD when only --staged is specified restore: reject invalid combinations with --staged restore: add --worktree and --staged checkout: factor out worktree checkout code restore: disable overlay mode by default restore: make pathspec mandatory restore: take tree-ish from --source option instead checkout: split part of it to new command 'restore' doc: promote "git switch" ...
Diffstat (limited to 'Documentation/git.txt')
-rw-r--r--Documentation/git.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/Documentation/git.txt b/Documentation/git.txt
index f9b09db..e095514 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -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)
-----------------------------