Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 SomeGuy22 · Feb 25, 2013 at 06:03 PM · editorprojectundoreplaceunitron

Undo asset replace? *emergency D:*

I imported prefabs from the asset store and it contained a script I already had named that, so naturally Unity replaced it without even telling me and I lost all progress on that script. Is there a way to undo this, or maybe a way to get unitron to pull a backup somehow? Thanks, this is project-threatening stuff...

Comment
Add comment · Show 6
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
avatar image SomeGuy22 · Feb 25, 2013 at 06:29 PM 0
Share

Using $$anonymous$$ac OS 10.6.8 :/ and yeah I was just about to make a backup :/ looks like I'll have to rewrite the biggest and most important 700 line script ;_; and I don't even remember most of it

avatar image numberkruncher · Feb 25, 2013 at 06:31 PM 0
Share

That's a pity! I do not know of an OS X alternative. Perhaps the Time $$anonymous$$achine feature can help you?

avatar image SomeGuy22 · Feb 25, 2013 at 06:35 PM 0
Share

I have time machine and it literally just ran out of space :/

avatar image numberkruncher · Feb 25, 2013 at 06:42 PM 0
Share

Search your project folder for compiled DLL files like ("Assembly-CSharp.dll"). I believe that you might be able to recover your source code (without comments) from there. Though I do not know how to do this, perhaps somebody else could assist if they know?

avatar image crappygraphix · Feb 25, 2013 at 07:08 PM 1
Share

This isn't an answer, more a suggestion to help prevent this headache for you in the future.

All flavors of Unity will let you select Edit->Project Settings->Editor from the menu and set Version Control to "$$anonymous$$eta Files".

$$anonymous$$y issue with version control was space since games have both assets and code. I use bitbucket.org to host my git repos and just stuff everything into them both code and non-code. They offer unlimited private repos and unlimited space for free (up to 5 users).

The last detail is remember to add the Library folder to .gitignore since it will be built by the meta files you activated earlier.

I'm sorry this doesn't fix your current problem but hopefully it will save you in the future.

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by SomeGuy22 · Feb 25, 2013 at 06:30 PM

Well I've found a solution... not the best but better than rewriting the entire code from memory. I got my friend (running Windows) to open Assembly-UnityScript.dll from a built program with ILSpy and found the script. It was converted to an unusable version of C#, meaning all I have to do is translate it to usable javascript with my own knowledge. It's a shame that I have to do all that extra work for what could've been avoided with a simple undo button -_-

Comment
Add comment · Show 4 · 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
avatar image numberkruncher · Feb 25, 2013 at 06:35 PM 0
Share

As an asset provider I have asked for this several times. I want a warning message to appear before importing any asset. You will find that many asset providers include warnings everywhere they can (readme, documentation, website, blog, release notes, etc.) but unfortunately those are not pro$$anonymous$$ent enough for people who just click the "Update/Import" button.

For example, special upgrade notices, or even generic "backup because you never know!" messages.

avatar image SomeGuy22 · Feb 25, 2013 at 06:36 PM 0
Share

That's me unfortunately :/

avatar image numberkruncher · Feb 25, 2013 at 06:39 PM 0
Share

It's very easily done though, sometimes a gentle re$$anonymous$$der is refreshing. $$anonymous$$y only advice for the future is to backup your work at least once a day.

Remember, you could get a virus/hacked also, so it is generally good advice. Preferably store your backups on an external media.

avatar image SomeGuy22 · Feb 25, 2013 at 06:42 PM 0
Share

Thanks for helping. I'll search around to see if I ever took video of the script or a screenshot, or even parts of it on unity forums and answers probably... Unity needs an undo system badly :P

avatar image
0

Answer by numberkruncher · Feb 25, 2013 at 06:29 PM

This is why you should always backup your files regularly, and also before updating/installing any packages from the asset store!

If you are using source control, then you will probably be able to recover from a previous commit.

If you are using Windows Vista/7 then you might be able to try this trick.

  • Right-click the new script using Windows Explorer and select "Properties".

  • Select the "Previous Versions" tab.

  • Wait a few seconds for the list to populate.

If you are lucky, then a previous version will appear.

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
avatar image
0

Answer by davedev · Feb 25, 2013 at 06:31 PM

Are you on mac or windows? On mac I think "replaced" files are moved to the trash so you might be able to retrieve it from there. Same might be true on Windows. Its a file level operation and really doesn't have anything to do with Unity i.e. the script isn't stored in Unity I think. So you are looking at operations to recover a deleted file.

Comment
Add comment · Show 1 · 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
avatar image SomeGuy22 · Feb 25, 2013 at 06:35 PM 0
Share

Replaced files are not moved to trash, they are "replaced" completely overwritten

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.

Follow this Question

Answers Answers and Comments

12 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

Related Questions

Why does the Editor open random folders in Project at startup? 2 Answers

Undo - mandatory for editor tools? 1 Answer

How to increase the size of my sprites in the Editor > Project previsualization? 0 Answers

Tell difference between Undo & Redo on callback 0 Answers

Error when starting new project 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges