title: How to re-seed a table identity in SQL Server 2008 and undo it all safely?
body: <p>I need to do this for testing only, but then undo it when the test is done.</p>
  
  <p>I have seen some tutorials online on how to re-seed a table, but not so much on how to undo it.</p>
  
  <p>Let's say the table definition is the following:</p>
  
  <pre><code>create table beer
  (
   beer_id  numeric(10) not null,
   mnemonic        nvarchar(8)
  );
  go
  </code></pre>
  
  <p>Let's say that I want the new identities to temporarily start at <code>12345</code>, and at the end delete the new rows and set the next identity to what it would have been.</p>