title: How to cancel/revert changes to an observable model (or replace model in array with untouched copy)
body: <p>I have a viewModel with an observableArray of objects with observable variables.</p>
  
  <p>My template shows the data with an edit button that hides the display elements and shows input elements with the values bound. You can start editing the data and then you have the option to cancel. I would like this cancel to revert to the unchanged version of the object.</p>
  
  <p>I have tried clone the object by doing something like this:</p>
  
  <pre><code>viewModel.tempContact = jQuery.extend({}, contact);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>viewModel.tempContact = jQuery.extend(true, {}, contact);
  </code></pre>
  
  <p>but viewModel.tempContact gets modified as soon as contact does.</p>
  
  <p>Is there anything built into KnockoutJS to handle this kind of situation or am I best off to just create a new contact with exactly the same details and replace the modified contact with the new contact on cancel?</p>
  
  <p>Any advice is greatly appreciated. Thanks!</p>