简体   繁体   English

如何“适当地”不对商品进行更改?

[英]how to “propertly” not commit changes on mercurial?

Accidentally i hg add ed several binary compiled files from a project along with tons of little changes on several files. 偶然地,我从一个项目中hg add了几个二进制编译文件,以及对几个文件的大量修改。

my hg status now show that i have a dozen files modified (correctly) and two dozen files added (mistake). 我的hg status现在表明我(正确地)修改了一打文件,并且添加了(错误)打了十二个文件。

how do i undo that? 我该如何撤消呢?

Most answers here tell me to install the MQ extension or to use rollback, but the manual for MQ ext says that i'm not really supposed to use it and that there are (slightly more complicated) ways of doing the same MQ does with mainline hg -- though it fails to show how. 这里的大多数答案都告诉我要安装MQ扩展或使用回滚,但是MQ ext的手册说我真的不应该使用它,并且有(稍微复杂些)与主线做相同的MQ的方法。 hg-尽管无法显示操作方法。 and rollback shows warnings about not being supposed to be used because it is deprecated. 回滚会显示有关由于不推荐使用而不会被使用的警告。

So, how do i remove from my upcoming commit the files added by mistake, while keeping the modified files that i want to commit? 那么,如何在我即将进行的提交中删除错误添加的文件,同时又保留要提交的已修改文件?

当您添加 (而不是修改)文件时,意外使用了hg forget FILENAME而不是hg revert FILENAME

You can revert those files. 您可以还原这些文件。 hg revert fileyouwanttorevert otherfileyouwanttorevert

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM