title: How to deal with modified models when using Backbone.history
body: <p>I have this fairly simple <code>controller</code>+<code>router</code> below for example purposes. My question is: How do I deal with the router and <code>Backbone.history</code> if I have modified a certain model?</p>
  
  <p>Let's say that I fire up a <code>route</code>r and a <code>controller</code>. The default route <code>""</code> brings me to the function <code>blue</code> where I set the background to the color blue. I can click on a button that will bring me to the function <code>red</code> where it sets the background red and the URL to <code>/#red</code>.</p>
  
  <p>If I click the back button, I will go back to my <code>""</code> url, but the background will stay red. Is there a way of getting the previous state and not only change the URL when dealing with the history?</p>
  
  <p>I understand that in function <code>blue</code>, I could just set the background to be blue and not to <code>this.model.get("background)</code>, but I am asking in more complex cases, how to get the previous state of <code>this.model</code> through the <code>Backbone.history</code>.</p>
  
  <pre><code>MyApp.module('Main', function (Main, MyApp, Backbone, Marionette, $, _){
  
      Main.Router = Marionette.AppRouter.extend({
          appRoutes: {
               "": "blue",
              "red": "red"
          }
      });
  
      Main.Controller = Marionette.Controller.extend({
          start: function() {
              console.log("MyApp Controller start...");
  
              this.model = new Backbone.Model({background: "blue"});
  
              Backbone.history.start()
          },
  
          blue: function() {
              $("body").css("background-color", this.model.get("background"));            
  
              $("#button").click(function() {
                  //MyApp.router.navigate("red", {trigger: true});
                  MyApp.controller.red();
              });
          },
  
          red: function() {
              this.model.set({background: "red"});
              $("body").css("background-color", this.model.get("background"));
              MyApp.router.navigate("red");
          }
      });
  });
  </code></pre>