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