How do I undo "added and private" changes?

I downloaded a new asset from the asset store which has about 300 materials in it. I want to prevent these from being checked in to my VCS to avoid blowing up the size of the repo, and instead add them individually as I decide to use each one.

But in unity VCS window I see every single one has been added automatically to “added and private” changes. I tried adding the folder to the ignore.conf file in the root of my assets folder but this doesn’t seem to be getting applied. I assume this is because these items are already added into the “added” context, and so are automatically being tracked and the ignore file is not being used?

When I right click on the root folder and click “undo” it gives me a scary warning that “this cannot be undone”. Then when i click continue it says: “To perform the undo checkout operation on directory… its contents must be added to the operation”

but I have selected every single item in the directory thats listed in the VCS window and it still gives me this error of having to add the contents to the operation.

A few questions and observations:

  1. Is there a way to bulk undo these added changes? It’s a bit frustrating there isn’t an obvious path to doing this in the UI, I assume this is a common-ish operation?
  2. Can I disable the “auto add changes” behavior? If its going to be such a pain to remove items from this list then I’d prefer to just disable the behavior
  3. Why does the “undo” operation give a scary warning about a non-undoable operation? Is this actually deleting the files? I really hope not, since its called “undo”… if its just removing the changes from the commit, then why the scary message? Surely I could just add them back to the commit list?
  4. Coming from git, I assume what is happening is a “git add *” is run automatically. I see the value in automatically staging items to be committed… But why does it need to be soft committed and entered into tracking immediately? Surely it could be just added to the commit list and then when I select “check in changes” it gets both added and committed? Then I can just add to the ignore.conf whenever instead of needing to do it before the items are created

Overall this is a frustratingly complicated experience. Coming from git it would be nice if unity VCS didn’t re-invent the wheel with new terminology like “added”, “private” and “hidden changes”, and if the UI the was a bit more intuitive about what exactly “undo” means here.

Thank you for the detailed explanation, @habahut

I certainly coincide with you on the misleading (scaring) message when you want to undo “added” files. While the “undo” operation has an important impact on changes files (modified, renamed, deleted, etc), the only thing it does for “added” files is to mark them back to private. However, the warning message is the same regardless of the type of files involved in the operation. This is actually a good catch, and something we will check for improvement (thanks!).

New files are, as you mentioned, automatically added to source control by default. But, based on users’ feedback, we included a new setting to control this specific behavior back in September 2024. Starting from the Version Control package version 2.5.1, you can find a new per-project setting “Automatically add new files to source control” at the very top of the Unity Version Control Settings panel, that you can toggle based on your needs.

Finally, I just want to confirm that what happened to your “added” files after ignoring the parent folder is expected. The state of the existing descendants isn’t altered, but any new file you create inside the folder will be definitely ignored (unless the user manually adds them to source control).

I’m using unity 2022.3.40f1, is it possible to update just the VCS component? Or would I need to be using a newer version of unity?

I appreciate that you agree with my assessment of the error message, glad to hear that will be looked into.

It does seem like if an object is “added but not committed”, adding it to the ignore file should remove it from the added list. At least thats what I would expect. I guess one could just undo that new file or set of files and then ignore it. It does seem like something strange was going on when I tried to undo the large folder with lots of assets, I was getting that error message and was unable to remove it. I had to move the entire folder on my hard drive, delete the .meta file, add it to ignore, then move it back in. So might be worth looking into if this is expected or not.

You do not need to upgrade your Unity version. Only the version of the Version Control package.