放弃 Xcode 4.2 中的所有更改

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7926151/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:15:46  来源:igfitidea点击:

Discard all changes in Xcode 4.2

xcodegitversion-control

提问by vietstone

I have an Xcode 4.2 project that uses git as repository. I make some changes in my source code files. In order to discard changes in one file, I do the following:

我有一个使用 git 作为存储库的 Xcode 4.2 项目。我在我的源代码文件中做了一些更改。为了丢弃一个文件中的更改,我执行以下操作:

  • Select that file in the Source Tree
  • Go to File > Source Control > Discard Changesto discard changes I made in that file
  • 源树中选择该文件
  • 转到“文件”>“源代码管理”>“放弃更改”以放弃我在该文件中所做的更改

But I want to discard all changes in all files in my project. How to do it?

但我想放弃我项目中所有文件的所有更改。怎么做?

回答by djromero

File > Source Control > Commit(??C), on the left pane select the files you want to reset, right click on selection and click Discard Changesin the context menu.

文件 > 源代码管理 > 提交(??C),在左侧窗格中选择要重置的文件,右键单击选择并在上下文菜单中单击放弃更改

回答by ari gold

You don't have to go to the commit screen to discard changes. Just highlight the file in the Project Navigator and select File > Source Control > Discard Changes.

您不必转到提交屏幕来放弃更改。只需在 Project Navigator 中突出显示该文件,然后选择File > Source Control > Discard Changes

回答by John Weldon

From the command line in the git repository you could do

从 git 存储库中的命令行,您可以执行

git co -- .

to reset the files to the HEAD revision.

将文件重置为 HEAD 修订版。