title: How to clear higher bytes in C# Flags Enum
body: <p>I am using a Flags Enum to track the completion stages of a data migration process for each data record. I need a way to reset back to a specified stage where I can begin reprocessing the migration of a data record. How does one reset the higher bytes in a Flags Enum?</p>
  
  <p>Example Enum:</p>
  
  <pre><code>[Flags]
  public Enum MigrationStages {
    None = 0,
    Started = 1,
    MiddleStage = 2,
    WrappingUp = 4,
    Finished = 8
  }
  </code></pre>
  
  <p>My current value:</p>
  
  <pre><code>var currentStage = 
      MigrationStages.None 
      | MigrationStages.Started 
      | MigrationStages.MiddleStage
      | MigrationStages.WrappingUp
      | MigrationStages.Finished;
  </code></pre>
  
  <p>I want to reset back to <code>MigrationStages.MiddleStage</code> to cause reprocessing to occur starting there.</p>