You have plenty of options, and it really just depends on what your style is and the design of your game.
One of the easier ways to handle this is with a simple scene manager. The first thing you need for scene manager is a script that persists between scenes. This can be done with a method called DontDestroyOnLoad
. A very simple scene manager would look something like this (written in C#, because that's what I use, but it should be easy enough to convert):
public class SceneManager: MonoBehaviour {
static string lastScene;
static string currentScene;
void Awake () {
DontDestroyOnLoad (this.transform.gameObject);
}
public static void ChangeScene(string sceneName) {
lastScene = currentScene;
currentScene = sceneName;
Application.LoadLevel(currentScene);
}
public static void LoadLastScene() {
string last = lastScene;
lastScene = currentScene;
currentScene = last;
Application.LoadLevel(currentScene);
}
}
Next, simply attach your script to an empty game object, and make sure that scene manager game object is created in the first scene. Then, just use the scene manager to handle all your scene changes, and you'll easily be able to go back a level.