From: Julia Evans via GitGitGadget Date: Wed, 03 Sep 2025 16:50:02 GMT Subject: [PATCH v3 6/6] doc: git-checkout: clarify restoring files section Message-ID: <90fe48cfe37852b9e245aa0f7b45383f9b879199.1756918202.git.gitgitgadget@gmail.com> In-Reply-To: From: Julia Evans - Reword to avoid jargon ("tree-ish", "index") where possible. Use "commit or tree" and "stage" (as a verb) instead where appropriate - Add examples - Use a simpler sentence structure to describe options for handling unmerged entries: "use -f to.., use --ours to..., or use -m to.." Signed-off-by: Julia Evans --- Documentation/git-checkout.adoc | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/Documentation/git-checkout.adoc b/Documentation/git-checkout.adoc index b361ff011a..ae19565f4f 100644 --- a/Documentation/git-checkout.adoc +++ b/Documentation/git-checkout.adoc @@ -74,23 +74,27 @@ Omitting __ detaches `HEAD` at the tip of the current branch. `git checkout [--] ...`:: `git checkout --pathspec-from-file= [--pathspec-file-nul]`:: - Overwrite both the index and the working tree with the - contents at the __ for the files that match the pathspec. + Replace the specified files and/or directories with the version from + the given commit or tree and stage the files' contents. ++ +For example, `git checkout main file.txt` will replace `file.txt` +with the version from `main`. `git checkout [-f|--ours|--theirs|-m|--conflict=