Edit on GitHub

Undo Adding Data

There are situations where you want to stop tracking data added previously. Follow the steps listed here to undo dvc add.

Let's first add a data file into an example project using dvc add, which creates a .dvc file to track the data:

$ dvc add data.csv
$ ls
data.csv    data.csv.dvc

Note, if you are using symlink or hardlink as link type for DVC cache, you will have to unprotect the tracked file first (see dvc unprotect):

$ dvc unprotect data.csv

Now let's reverse dvc add by removing the corresponding .dvc file and .gitignore entry using dvc remove:

$ dvc remove data.csv.dvc

Data file data.csv is now no longer being tracked by DVC.

$ git status
    Untracked files:
        data.csv

You can run dvc gc with the -w option to remove the data that isn't referenced in the current workspace from the cache:

$ dvc gc -w

๐Ÿ› Found an issue? Let us know! Or fix it:

Edit on GitHub

โ“ Have a question? Join our chat, we will help you:

Discord Chat