- Home /
Every Single Object "Missing Prefab" after Git Revert
tl;dr I did a code revert and now every single prefab in my scene says "Missing Prefab" in red and my whole project is shot.
Long version:
*Worked on my project for a while on my Macbook. Everything running fine.
*Did a commit from Sourcetree to github.
*Moved to desktop. Did a pull request from github via Sourcetree. Everything working fine.
*Wrote some code and made some changes that didn't work out. Oh well.
*Went to Sourcetree. Found last commit I wanted. Right clicked and chose "Reset current branch to this commit." Chose "Hard reset.
Outcome:
*Every game object in every scene is now just a "Missing Prefab" if it was a prefab on my PC. On my Macbook everything is fine.
Things I've tried to fix it:
*Asset reimport.
*Making sure editor is set to have visible meta files and text mode forced (it was the whole time)
*Deleting Library file
*Redownloading the entire stupid thing from git repo
*Making sure gitignore wasn't ignoring .meta files (it wasn't)
Even after redownloading the entire project, every prefab reference is still broken. I literally can't even work on my game at my PC now. Any advice much appreciated. I don't know what the hell is going on, but I'm at a complete standstill and I've been trying to fix this for hours. Thanks.
Answer by FabianP · Mar 04, 2019 at 11:46 PM
I had a similar issue. My solution is the following:
Close Unity
Delete All Project files in your Repo (but .git)
In Terminal:
git reflog
And then:
git reset --hard <hash of your last commit>
I hope this works for you as well ;)
Your answer
Follow this Question
Related Questions
What is the right way to update a Prefab in a team environment? 0 Answers
How to, git commit, the auto light bake setting ? 1 Answer
How to properly use git with a team? 3 Answers
How to use Visual Studios with Git source control? 0 Answers
Behaviour is missing when using project on different computer. 1 Answer