1
2---
3title: "How to revert a CL"
4linkTitle: "How to revert a CL"
5
6---
7
8
9Using one-click revert
10----------------------
11*   Find the codereview issue for the CL you want to revert.
12*   Click the "revert" button.
13
14Using Git
15---------
16
17Update the local repository
18
19    git fetch origin master
20
21Create a local branch with origin/master as its start point.
22
23    git checkout -b revert$RANDOM origin/master
24
25Find the SHA1 of the commit you want to revert
26
27    git log origin/master
28
29Create a revert commit.
30
31    git revert <SHA1>
32
33Upload it to Gerrit.
34
35    git cl upload
36
37Land the revert in origin/master.
38
39    git cl land
40
41Delete the local revert branch.
42
43    git checkout --detach && git branch -D @{-1}
44
45
46