- Home /
How do I restore my prefabs from my Git repository?
I have set up my Unity 4.0 project in a Git repository with the following gitignore:
.DS_Store
Library/AssetImportState
Library/AssetServerCacheV3
Library/FailedAssetImports.txt
Library/ScriptAssemblies
Library/ScriptMapper
Library/assetDatabase3
Library/cache
Library/expandedItems
Library/metadata
Library/previews
Library/guidmapper
Temp
*.pidb
build
I was working on a bug in my scene, and I decided to go back to my last git commit with git checkout. However, after doing that, two of my prefabs (they were pretty complicated with nested objects) disappeared from my scene and now they appear as white boxes in the Prefabs folder in my project. Why did this happen, and is it possible to restore them in any way?
I know this is a bit late, but have you tried using Git UniTEA$$anonymous$$ from the asset store? It's an editor extension that lets you manage your Git versioned project.
$$anonymous$$ake sure you ignore everything in Library, so just put Library/
Answer by AnomalusUndrdog · Apr 07, 2013 at 08:05 PM
Like nsxdavid said, the whole Library folder should be ignored. Enable meta files if it isn't already, update your gitignore to ignore the whole Library folder, then delete your Library folder, so that Unity will recreate it with the proper data set up. You'll probably want to reset to some earlier commit where things were still ok.
And backup everything first, in case things get worse.
Your answer
Follow this Question
Related Questions
Build platform doesn't stick when using VCS (Git) 2 Answers
Git and Unity not working correctly: missing components, textures, materials, etc. 2 Answers
Problems merging scene files - Not a valid YAML file 0 Answers
Prefabs marked as modified in SVN when modifying script associated with it? 1 Answer
Git Version Control Merging 1 Answer