1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/git-checkout-index.md
2025-04-27 10:59:15 +03:00

20 lines
719 B
Markdown

# 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 {{[-a|--all]}}`
- Restore any files deleted or changed since the last commit:
`git checkout-index {{[-a|--all]}} {{[-f|--force]}}`
- Restore any files changed since the last commit, ignoring any files that were deleted:
`git checkout-index {{[-a|--all]}} {{[-f|--force]}} {{[-n|--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 {{[-a|--all]}} {{[-f|--force]}} --prefix {{path/to/export_directory/}}`