Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pages/common/git-checkout-index.md
Original file line number Diff line number Diff line change
@@ -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 last commit:

`git checkout-index --all`

- Restore any files deleted or changed since last commit:

`git checkout-index --all --force`

- Restore any files changed since last commit (ignoring deleted files):

`git checkout-index --all --force --no-create`

- Export a copy of the entire tree at the last commit in the specified directory (the trailing slash is important):

`git checkout-index --all --force --prefix={{git-index-export/}}`