Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to: "undo" 'dvc add' + other "how to undo mistakes" recipes #625

Closed
gwerbin opened this issue Sep 17, 2019 · 8 comments · Fixed by #1705
Closed

how to: "undo" 'dvc add' + other "how to undo mistakes" recipes #625

gwerbin opened this issue Sep 17, 2019 · 8 comments · Fixed by #1705
Labels
A: docs Area: user documentation (gatsby-theme-iterative) type: enhancement Something is not clear, small updates, improvement suggestions

Comments

@gwerbin
Copy link
Contributor

gwerbin commented Sep 17, 2019

This issue is 1 of 3 that I was asked to post here, following a conversation on Discord with mroutis and ivan

I encountered this problem within my first 15 minutes of using DVC: "how do I undo dvc add?"

The answer turns out to be:

  1. unprotect the file, just in case
  2. Delete its corresponding .dvc file
  3. Optionally run gc or look up the MD5 in data.dvc and delete it from .dvc/cache by hand.

It would be nice if this recipe were included somewhere in the docs.

Part of the reason this procedure was so non-obvious is that I never thought to look in https://dvc.org/doc/commands-reference/add. This turns out to have a complete technical explanation of linking, and what "protect" means in DVC. This document should be referenced early and often, maybe with a sentence like "For a technical explanation of the caching and linking process, see here".

In the meantime, hopefully my Stackoverflow self-answer will help other users, as well as get the DVC ball rolling on Stackoverflow.

DVC, like Git, admits the possibility of potentially-destructive beginner mistakes. I think it would be good practice to try and anticipate and provide recipes for undoing mistakes, and link to them prominently in the getting started documentation.

@shcheklein shcheklein added A: docs Area: user documentation (gatsby-theme-iterative) type: enhancement Something is not clear, small updates, improvement suggestions user-guide labels Sep 17, 2019
@shcheklein shcheklein changed the title Explain how to "undo" 'dvc add' + other "how to undo mistakes" recipes explain how to "undo" 'dvc add' + other "how to undo mistakes" recipes Sep 17, 2019
@dashohoxha
Copy link
Contributor

@gwerbin There is an example of how to undo dvc add here: https://katacoda.com/dvc/courses/basics/data-management
However this is still unfinished work and not yet advertised on the website of DVC.

@dashohoxha
Copy link
Contributor

In the meantime, hopefully my Stackoverflow self-answer will help other users, as well as get the DVC ball rolling on Stackoverflow.

There is also a stackexchange about DS: https://datascience.stackexchange.com

@Suor
Copy link
Contributor

Suor commented Oct 3, 2019

I feel that there should be an easier way)

@shcheklein
Copy link
Member

@Suor do you meant that there is an easier way already, or rather that it's a good sign to implement one? like dvc reset or something?

@Suor
Copy link
Contributor

Suor commented Oct 3, 2019

@shcheklein I don't see one, but there probably should be. I am surprised dvc remove does something arcane instead of this.

@Suor
Copy link
Contributor

Suor commented Oct 3, 2019

BTW, this recipe is also dangerous considering how dvc gc operates.

@shcheklein
Copy link
Member

@Suor agreed! Could you create a ticket for this on the DVC core repo? I also think that using current dvc gc is close to nuclear bombing. I would recommend to remove file manually for now.

@Suor
Copy link
Contributor

Suor commented Oct 5, 2019

Removing file from cache by hand is also unsafe, that one might be referenced somewhere else.

@dashohoxha dashohoxha mentioned this issue Oct 25, 2019
10 tasks
@jorgeorpinel jorgeorpinel changed the title explain how to "undo" 'dvc add' + other "how to undo mistakes" recipes how to: "undo" 'dvc add' + other "how to undo mistakes" recipes Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: docs Area: user documentation (gatsby-theme-iterative) type: enhancement Something is not clear, small updates, improvement suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants