2015-01-21 20:05:47 +00:00
|
|
|
How to revert a CL
|
|
|
|
==================
|
|
|
|
|
|
|
|
Using one-click revert
|
|
|
|
----------------------
|
2015-01-26 20:38:59 +00:00
|
|
|
* Find the codereview issue for the CL you want to revert.
|
|
|
|
* Click the "revert" button.
|
2015-01-21 20:05:47 +00:00
|
|
|
|
|
|
|
Using Git
|
|
|
|
---------
|
2015-01-26 20:38:59 +00:00
|
|
|
|
|
|
|
Update the local repository
|
|
|
|
|
|
|
|
git fetch origin master
|
|
|
|
|
|
|
|
Create a local branch with origin/master as its start point.
|
|
|
|
|
|
|
|
git checkout -b revert$RANDOM origin/master
|
|
|
|
|
|
|
|
Find the SHA1 of the commit you want to revert
|
|
|
|
|
|
|
|
git log origin/master
|
|
|
|
|
|
|
|
Create a revert commit.
|
|
|
|
|
|
|
|
git revert <SHA1>
|
|
|
|
|
2016-11-10 15:07:29 +00:00
|
|
|
Upload it to Gerrit.
|
2015-01-26 20:38:59 +00:00
|
|
|
|
|
|
|
git cl upload
|
|
|
|
|
|
|
|
Land the revert in origin/master.
|
|
|
|
|
|
|
|
git cl land
|
|
|
|
|
|
|
|
Delete the local revert branch.
|
|
|
|
|
|
|
|
git checkout --detach && git branch -D @{-1}
|
|
|
|
|