asdf
asdf

Reputation: 21

how to "propertly" not commit changes on mercurial?

Accidentally i hg added several binary compiled files from a project along with tons of little changes on several files.

my hg status now show that i have a dozen files modified (correctly) and two dozen files added (mistake).

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. 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?

Upvotes: 0

Views: 24

Answers (2)

planetmaker
planetmaker

Reputation: 6044

When you added (instead of modified) the files accidentially use hg forget FILENAME instead of hg revert FILENAME.

Upvotes: 1

Mathiasdm
Mathiasdm

Reputation: 1831

You can revert those files. hg revert fileyouwanttorevert otherfileyouwanttorevert

Upvotes: 0

Related Questions