5 In the case that some spam or inappropriate comment makes its way
6 through you interface, you can (sometimes) remove the offending commit
10 If the offending commit is the last commit
11 ==========================================
13 +-------+--------------------------------------------------------------+
15 +-------+--------------------------------------------------------------+
16 | bzr | bzr uncommit && bzr revert |
17 +-------+--------------------------------------------------------------+
18 | darcs | darcs obliterate --last=1 |
19 +-------+--------------------------------------------------------------+
20 | git | git reset --hard HEAD^ |
21 +-------+--------------------------------------------------------------+
22 | hg | hg rollback && hg revert |
23 +-------+--------------------------------------------------------------+
24 | mtn | mtn db kill_rev_locally $(mtn automate get_base_revision_id) |
25 +-------+--------------------------------------------------------------+
27 If the offending commit is not the last commit
28 ==============================================
30 +----------+-----------------------------------------------+
32 +----------+-----------------------------------------------+
33 | bzr [#]_ | bzr rebase -r <XYZ+1>..-1 --onto before:XYZ . |
34 +----------+-----------------------------------------------+
35 | darcs | darcs obliterate --matches 'name XYZ' |
36 +----------+-----------------------------------------------+
37 | git | git rebase --onto XYZ~1 XYZ |
38 +----------+-----------------------------------------------+
40 +----------+-----------------------------------------------+
42 +----------+-----------------------------------------------+
44 .. [#] Requires the ```bzr-rebase`` plugin`_. Note, you have to
45 increment ``XYZ`` by hand for ``<XYZ+1>``, because ``bzr`` does not
46 support ``after:XYZ``.
48 .. [#] From `Mercurial, The Definitive Guide`_:
50 "Mercurial also does not provide a way to make a file or
51 changeset completely disappear from history, because there is no
52 way to enforce its disappearance"
54 .. [#] See `Rebuilding ancestry`_ in the Monotone documentation.
56 .. _bzr-rebase plugin: http://wiki.bazaar.canonical.com/Rebase
57 .. _Mercurial, The Definitive Guide:
58 http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html#id394667
59 .. _Rebuilding ancestry:
60 http://www.monotone.ca/docs/Rebuilding-ancestry.html
62 Warnings about changing history
63 ===============================
65 Note that all of these *change the repo history* , so only do this on
66 your interface-specific repo before it interacts with any other repo.
67 Otherwise, you'll have to survive by cherry-picking only the good