Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to undo hg add

📅 2014-Jun-06 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ mercurial ⬩ 📚 Archive

If you did hg add and mistakenly added some files, then do not worry. As long as you have not committed them, this operation can be undone easily by using revert.

For example:

$ hg add foobar

To undo this:

$ hg revert foobar

Tried with: Mercurial 2.8.2 and Ubuntu 14.04

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧