Is there any way to undo a checkout programmatically in C#?
The files get checked out programmatically, but if the code does not change on execution, I want the checkout to be undone.
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);
}
The above code is my checkout code.