Archive for the 'dvcs' Category


mercurial remove specific commit from history

hg init
touch a b c d
hg add .
hg commit -m a a
hg commit -m b b
hg commit -m c c
hg commit -m d d

Let’s say we want to remove the commit b:

hg qinit -c
hg qimport -r1:tip
hg qpop -a
hg qdele 1.diff
hg qpush 2.diff
hg qfold 3.diff
hg qref -m "new commit message"
hg qfinish -a

Blog Stats

  • 223,713 hits