git-checkout-index: add page (#5107)

* git-checkout-index: add page

* Update pages/common/git-checkout-index.md

* Apply suggestions from code review

Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>

Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
This commit is contained in:
bl-ue 2021-01-13 08:39:56 -05:00 committed by GitHub
parent b962122415
commit b9e4ed66d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,20 @@
# git checkout-index
> Copy files from the index to the working tree.
> More information: <https://git-scm.com/docs/git-checkout-index>.
- Restore any files deleted since the last commit:
`git checkout-index --all`
- Restore any files deleted or changed since the last commit:
`git checkout-index --all --force`
- Restore any files changed since the last commit, ignoring any files that were deleted:
`git checkout-index --all --force --no-create`
- Export a copy of the entire tree at the last commit to the specified directory (the trailing slash is important):
`git checkout-index --all --force --prefix={{path/to/export_directory/}}`