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 +-------+----------------------------+
25 If the offending commit is not the last commit
26 ==============================================
28 +----------+-----------------------------------------------+
30 +----------+-----------------------------------------------+
31 | bzr [#]_ | bzr rebase -r <XYZ+1>..-1 --onto before:XYZ . |
32 +----------+-----------------------------------------------+
33 | darcs | darcs obliterate --matches 'name XYZ' |
34 +----------+-----------------------------------------------+
35 | git | git rebase --onto XYZ~1 XYZ |
36 +----------+-----------------------------------------------+
38 +----------+-----------------------------------------------+
40 .. [#] Requires the ```bzr-rebase`` plugin`_. Note, you have to
41 increment ``XYZ`` by hand for ``<XYZ+1>``, because ``bzr`` does not
42 support ``after:XYZ``.
44 .. [#] From `Mercurial: The Definitive Guide`:
46 "Mercurial also does not provide a way to make a file or
47 changeset completely disappear from history, because there is no
48 way to enforce its disappearance"
50 .. _bzr-rebase plugin: http://wiki.bazaar.canonical.com/Rebase
51 .. _Mercurial: The Definitive Guide:
52 http://hgbook.red-bean.com/read/finding-and-fixing-mistakes.html#id394667
54 Warnings about changing history
55 ===============================
57 Note that all of these *change the repo history* , so only do this on
58 your interface-specific repo before it interacts with any other repo.
59 Otherwise, you'll have to survive by cherry-picking only the good