I accidentally deleted the files from a network computer and somehow they weren’t sent to recycle bin.
I have Unity version control and I just made a changeset before deleting the files but most of the script files weren’t changed recently so they aren’t in this changeset. I just couldn’t figure out how to recover all of the files. How can I recover these files? Do I go back to some other changeset first and go step by step? I’m afraid to make more changes and ruin the project completely.
Edit: I see the folders and files deleted here. Do I just press undo?
Is there a way to create a copy of a project on a different computer like this?
Edit: my problem is I moved some folders around and now somehow there are duplicate files which breaks lots of things. The GUIDs are changed and I don’t want that to happen.
Edit2: I had to manually delete some files and alter GUIDs of remaining ones to fix the issues but it’s solved.
Christ, in their post they clear state they’re using Unity’s Version Control. Read the posts before commenting.
Apologies OP, I haven’t used Unity’s Version Control so I don’t have specific help here. Can only suggest reading the documentation/manual on Unity’s VC solution to see if they have guides about this particular scenario.
I have! Undoing deletions (if the files were saved in the repository) is a simple matter: either use the checkboxes to select items to revert and use the “Undo” button at the top or highlight the items you want to revert (shift/control for multi-selection) and use the right-click Undo context menu action.
Perhaps check that your pending changes or changesets after your accidental deletion show only the modifications you expect as a sanity check, like items only being moved as opposed to changed/added/deleted if your operation was indeed only meant to be shuffling folders around.
If you’d like, you can mark your post as the solution to this thread to indicate you’re all set and to discourage weird or unnecessary posts.
Always use asset files along with their meta file. Move (or delete) files within the editor, not through Finder or Explorer windows. Use source control (GitHub Desktop is easy to understandand YouTube tutorials should get you started within a day) and you will quickly figure out how this works behind the scene.
Think of all asset files and scripts as generic cars, and the meta files as their number plate. Editor needs the plate (meta file) to identify the file. If a file appears without a meta file, the editor will re-import it and assign new GUIDs (creating a new meta file). This breaks all previous references in the project.
(Note: Meta files should be set to always visible in the project settings, but I guess this is the default)
Thanks, I know all that but the problem was the files I moved around weren’t recognized by the version control for some reason OR some of them were protected and they weren’t deleted by it. I will try to be more careful when I move things around from now on.