Mercurial Cheat Sheet

Another page that would rather be hosted on a wiki. These are my notes on how to do various things in Mercurial.

A Mercurial cheat sheet. Written for a non-expert for non-experts.

This is a work in progress. Check back later to see what’s new!


For expert advice, take a look at Finding and Fixing Mistakes, chapter 9 in Mercurial: The Definitive Guide by Bryan O’Sullivan.

To roll back an “accidental” change after a commit:

hg rollback

To undo a change to a file before you’ve committed:

hg revert filename

The above works with wildcards, but I wouldn’t..

To back out the last changeset committed:

hg backout -m 'Back out this change' tip
This entry was posted in System Administration on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).