xref: /aosp_15_r20/external/skia/site/docs/dev/contrib/revert.md (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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 main
20
21Create a local branch with origin/main as its start point.
22
23    git checkout -b revert$RANDOM origin/main
24
25Find the SHA1 of the commit you want to revert
26
27    git log origin/main
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/main.
38
39    git cl land
40
41Delete the local revert branch.
42
43    git checkout --detach && git branch -D @{-1}
44
45
46