mercurial discard all added files prior to a commit
mercurial
Solution
If you want to just use internal `hg`commands, you can do the following:
hg forget "set:added()"
Which will forget any file that's marked as "added" in the working directory. It makes use of the rather powerful filesets feature of Mercurial.
There are additional filters you can use when specifying files, which allows you to easily fix other mistakes. For example, easily re-add removed files but nothing else `hg add "set:removed()"`. The functionality is similar to (tho' thankfully simpler than) mercurial revsets, and can be studied with:
hg help filesets
Problem
Just made the mistake of using `addremove` to try and remove some files that were deleted without using `hg remove` Now have hundreds of files that are going to be added on the next commit Is there anyway I can quickly remove all these added files without having to resort to a bash script or even worse `hg removing` or `forgetting` each file manually?