Scene lost after scene switching?

So I have done quite a bit of work today in one particular scene and after I finished I tested out my entire project and at some point I had switched to a new scene in c# using the unity scene manager. After I switched and came back all my progress in my old scene was completely gone. I don’t see how I should lose that progress if I don’t close Unity, especially without a dialog asking if I would like to save before I click play. Why does Unity do this and is there a way to get my progress back?

  1. Unity does this because a script told it to load a scene, so it loaded a scene. The script did not, in particular, tell Unity to prompt you to save first. To do that, you have to explicitly tell the editor to do so using: EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()
  2. Unfortunately, no. There’s no way to get your progress back. at this point.