title: Undo checkout TFS
body: <p>Is there any way to undo a checkout programmatically in C#?</p>
  
  <p>The files get checked out programmatically, but if the code does not change on execution, I want the checkout to be undone.</p>
  
  
  
  <pre><code>public static void CheckOutFromTFS(string fileName)
  {
      var workspaceInfo = Workstation.Current.GetLocalWorkspaceInfo(fileName);
      if (workspaceInfo == null)
          return;
  
      var server = new TfsTeamProjectCollection(workspaceInfo.ServerUri);
      var workspace = workspaceInfo.GetWorkspace(server);
      workspace.PendEdit(fileName);
  }
  </code></pre>
  
  <p>The above code is my checkout code.</p>