Code After going online, you will encounter problems and bugs. Generally, the most direct thing is to roll back to a previous version: 1. First, use git log to view the version to be rolled back.
[Lixinglei @ bogon my] $ git logcommit commit: 248cba8 944274 fauthor: lixinglei <lixinglei@zhangyue.com> date: Thu Jul 4 19:33:55 2013 + 0800 requirement 3 commit: lixinglei <lixinglei@zhangyue.com> date: thu Jul 4 19:33:49 2013 + 0800 requirement 2 commit 944274f83b945610d1ff08eaabceaad64f161505author: lixinglei <lixinglei@zhangyue.com> date: Thu Jul 4 19:33:10 2013 + 0800 requirement 1
2. If you want to roll back to the version of "requirement 2", you can directly use git reset online and use git log to confirm the current version:
[Lixinglei @ bogon my] $ git reset -- hard commit is now at 248cba8 requirement 2 [lixinglei @ bogon my] $ git logcommit commit: lixinglei <lixinglei@zhangyue.com> date: thu Jul 4 19:33:49 2013 + 0800 requirement 2
3. In this way, the code is rolled back to the desired version. If it is online, the service is usually restarted. Of course, there are other methods to roll back. Online is the most practical.