Synopsis
Description
Thedvc checkout command updates the workspace to match the data files specified in .dvc files. It restores or updates data files from the DVC cache to your workspace.
This command is typically used:
- After switching Git branches to sync data files
- After pulling changes from Git that update
.dvcfiles - To restore files that were deleted or modified
- To recreate file links between cache and workspace
dvc checkout, DVC:
- Reads the hash values from
.dvcfiles ordvc.lock - Finds the corresponding data in the local cache
- Links (or copies) the cached files to your workspace
- Updates or deletes files as needed to match the
.dvcspecifications
If data is missing from the cache, use
dvc fetch or dvc pull to download it from remote storage first.Options
Limit command scope to specific tracked files/directories,
.dvc files, or stage names. If not specified, checks out all tracked data.Show summary of the changes instead of detailed file-by-file output.
Checkout all dependencies of the specified target. Useful when working with DVC pipelines.
Checkout all subdirectories of the specified directory.
Do not prompt when removing working directory files. Forces checkout even if it means overwriting modified files.
Recreate links or copies from cache to workspace. Useful if you’ve changed cache link types in your configuration.
Ignore errors if some of the files or directories are missing from cache.
Examples
Basic checkout
Checkout all tracked data files:M- Modified (file was updated)A- Added (new file was created)D- Deleted (file was removed)
Checkout after switching branches
A common workflow when switching Git branches:Checkout specific files
Checkout only specific targets:Show summary
Get a high-level summary instead of file-by-file details:Force checkout
Overwrite local changes and force checkout:Relink files
Recreate links from cache (useful after changing cache configuration):Recursive checkout
Checkout all files in a directory and its subdirectories:Example workflows
Workflow 1: After pulling Git changes
Workflow 2: Restore deleted data
Workflow 3: Working with pipelines
Handling missing files
If files are missing from cache, you’ll see an error:dvc pull to do both in one command:
Performance tips
Related commands
dvc fetch- Download files from remote storage to cachedvc pull- Fetch and checkout in one commanddvc commit- Save changes to tracked filesdvc status- Show which files have changed