如何恢复 Team Foundation 服务器中的变更集?

发布于 2024-11-02 17:23:44 字数 126 浏览 0 评论 0原文

我是 Team Foundation 服务器的新手,有人在前一天晚上提交了不应该进行的更改。我需要恢复这个变更集,这样当人们获得最新版本时他们就不会得到这些更改。

我认为没有简单的方法可以做到这一点,有人有这方面的经验吗?

I am new to Team Foundation server and someone committed changes that they weren't supposed to the night previous. I need to revert this changeset so that when people get latest version they will not get these changes.

I see no easy way to do this, does anyone have experience with this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

网名女生简单气质 2024-11-09 17:23:44

您无法真正回滚变更集。您要做的是:

  1. 找到您想要返回的变更集编号。
  2. 签出所有需要回滚的文件。
  3. 执行获取特定版本(与获取版本不同)并指定变更集编号,然后选择选项以使用变更集中的内容覆盖本地副本。
  4. 执行签入,这将覆盖服务器上的内容。

您必须为每个文件单独执行此操作。您可以在其中查看 TFS Power 工具,它具有回滚功能,可以自动执行上面列出的手动步骤。

祝你好运!

You can't really rollback a changeset. What you have to do is:

  1. Find the changeset number you want to get back to.
  2. Perform a check-out of all the files that is in need of a rollback.
  3. Perform a get specific version (different from get version) and specify the changeset number and select the options to overwrite your local copy with what's in the changeset.
  4. Perform a check-in which would overwrite what is on the server.

You have to do this separately for every file. There you can look at the TFS Power tools which has a rollback that kinda automates the manual steps listed above.

Good luck!

段念尘 2024-11-09 17:23:44

我认为您正在寻找回滚命令:
回滚文档

I think you are looking for the rollback command:
Rollback docs

这个俗人 2024-11-09 17:23:44

您可以在 VS2010 中通过一个漂亮的界面轻松完成此操作,与使用 Tortoise SVN 类似,只要您也在后端使用 TFS 2010(在尝试之前请确保是这种情况)以下,否则无法工作):

获取 Team Foundation Server Power Tools 2011 年 12 月

(您可能需要重新启动计算机安装后)

然后在 VS2010 中转到 View >其他窗口>源代码管理资源管理器

在源代码管理资源管理器窗口中右键单击项目并选择“回滚” - 这将为您提供 本文(请阅读标题为“回滚可用于UI Now”,它为您提供了所有剩余的详细信息,以帮助您找到正确的方向)。
界面有点笨拙,但应该可以完成工作。

You can do this easily in VS2010 via a nice interface, in a similar way you'd do it with Tortoise SVN, as long as you are also using TFS 2010 on the back-end (make sure this is the case before you try the following, otherwise it won't work):

Get the Team Foundation Server Power Tools December 2011

(You may need to restart your computer after the install)

Then in VS2010 go to View > Other Windows > Source Control Explorer

right-click the project from the Source Control Explorer window and select 'Rollback' - this gives you the rollback dialogue shown in this article (read this from the section titled 'Rollback Available in the UI Now', it gives you all the remaining detail to get you in the right direction).
The interface is a little clumsy, but should do the job.

葬花如无物 2024-11-09 17:23:44

在团队资源管理器中右键单击您的代码,然后单击“查看历史记录”,然后一一选择您的文件,然后右键单击文件选择“获取特定版本”,然后将打开一个模型窗口。将类型组合框值最新版本更改为变更集编号,并将最新代码恢复为之前的变更集。

希望这有帮助......

Right click on your code in Team Explorer and click on view history then select your files one by one and right click on files choose get specific version and then a model window would open. Change type combobox value latest version to changeset number and revert the latest code to previous changeset.

Hope this helps....

兰花执着 2024-11-09 17:23:44

您可以通过 Visual Studio 命令提示符完成此操作,甚至不需要拥有代码的本地副本:

# create a temporary folder
mkdir some-workspace && cd some-workspace

# create a temporary workspace
tf workspace /new /collection:http://tfs-host:8080/tfs/some-collection some-workspace

# negate a specific changeset
tf rollback /changeset:some-changeset

# check in the rollback
tf checkin

# delete the temporary workspace
tf workspace /delete some-workspace

# delete the temporary folder
cd .. && rd some-workspace

You can accomplish this from the Visual Studio Command Prompt and you don't even need to have a local copy of the code:

# create a temporary folder
mkdir some-workspace && cd some-workspace

# create a temporary workspace
tf workspace /new /collection:http://tfs-host:8080/tfs/some-collection some-workspace

# negate a specific changeset
tf rollback /changeset:some-changeset

# check in the rollback
tf checkin

# delete the temporary workspace
tf workspace /delete some-workspace

# delete the temporary folder
cd .. && rd some-workspace
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文