summaryrefslogtreecommitdiffhomepage
path: root/blog/entry/revertisinversecp.mdwn
blob: 01a45cb0246039619573e7836f20cd7941e228fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
[[!meta date="2012-08-27 16:15:00"]]
[[!meta title="git revert is an inverse of cherry-pick"]]
[[!tag  imported_PyBlosxom tech git]]

`git revert` is an inverse of `git cherry-pick`. I had a branch `raven`
earlier and I wanted some changes from it to be standard in master with
a replacement branch with the converse of those changes. So

    $ git checkout master
    $ git merge raven
    $ git checkout -b newbranch
    $ git revert -n [sha of the changes] <-- THIS is literally:
                                          invert the commit and cherry-pick it