• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Rathlord · Oct 18, 2018 at 02:24 PM · prefabgitsource-control

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.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by FabianP · Mar 04, 2019 at 11:46 PM

I had a similar issue. My solution is the following:


  1. Close Unity

  2. Delete All Project files in your Repo (but .git)

  3. In Terminal: git reflog

  4. And then: git reset --hard <hash of your last commit>

I hope this works for you as well ;)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

120 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

What is the right way to update a Prefab in a team environment? 0 Answers

SourceTree Hangs (not responding) with Unity Large Project 0 Answers

Missing Materials With Source Control 1 Answer

problems moving project between computers using Sourcetree and bitbucket, 0 Answers

Git won't find Metafiles 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges