static void RestoreFile(string path, string bakPath) { if (File.Exists(path)) { File.Delete(path); } if (File.Exists(bakPath)) { File.Move(bakPath, path); } }