git - How to rollback to a older commit as I have pushed a code? -
i working on 2 different branches a
, b
, had 1 prod branch master
, created new branch c
combining a
, b
.
i have accidentally pushed c
to master
, , not know how go prod state, there many commits in place.
commit 92e15c92d543e436bd5804ab6c9 author: user_a date: thu sep 22 15:51:47 2016 +0530 fixing user report commit dfd1f4e0d56f50d263d6e merge: 1a6bc83 f9b0a35 author: user_a date: thu sep 22 15:47:01 2016 +0530 merge branch 'master' of git_repo_branch b commit 1a6bc83c55cf1b3d7f88d author: user_a date: thu sep 22 15:46:46 2016 +0530 fixing user report commit dd11a998f380c70b579d2a0 author: user_a date: thu sep 22 13:09:29 2016 +0530 fixing rake task commit c194f900e58f93b0a06ed author: user_a date: thu sep 22 13:08:40 2016 +0530 fixing rake task commit f9b0a35430d29826622d95 author: user_b date: thu sep 22 11:36:50 2016 +0530 jobs save draft fix commit 3a1b233b365a96886e2d73 merge: 2eac96c c4f61b1 author: user_a date: thu sep 22 11:35:20 2016 +0530 merge branch 'a' b commit dfd1f4e0d56f50d263d6eb5 merge: 1a6bc83 f9b0a35 author: user_a date: thu sep 22 15:47:01 2016 +0530 merge branch 'master' of git_repo_branch b commit 1a6bc83c55cf1b3d7f88da697411d5c5acb5b9c4 author: user_a date: thu sep 22 15:46:46 2016 +0530 fixing user report commit dd11a998f380c70b579d2a0b author: user_a date: thu sep 22 13:09:29 2016 +0530 fixing rake task commit c194f900e58f93b0a06eddf8 author: user_a date: thu sep 22 13:08:40 2016 +0530 fixing rake task commit f9b0a35430d29826622d9 author: user_b date: thu sep 22 11:36:50 2016 +0530 jobs save draft fix commit 3a1b233b365a96886e2d7334 merge: 2eac96c c4f61b1 author: user_a date: thu sep 22 11:35:20 2016 +0530 merge branch 'a' b commit c4f61b151c28ce36b0c7987276df90ddc91c84fc merge: 0f18c62 fb70961 author: user_a date: thu sep 22 11:35:04 2016 +0530 commit f9b0a35430d29826622d950b9e149c05cf937644 author: user_b date: thu sep 22 11:36:50 2016 +0530 jobs save draft fix commit 3a1b233b365a96886e2d73 merge: 2eac96c c4f61b1 author: user_a date: thu sep 22 11:35:20 2016 +0530 author: user_a date: thu sep 22 13:08:40 2016 +0530 fixing rake task commit f9b0a35430d29826622d950b9 author: user_b date: thu sep 22 11:36:50 2016 +0530 jobs save draft fix commit 3a1b233b365a96886e2d733403fa66e8dd4992fc merge: 2eac96c c4f61b1 author: user_a date: thu sep 22 11:35:20 2016 +0530 merge branch 'a' b commit c4f61b151c28ce36b0c79872 merge: 0f18c62 fb70961 author: user_a date: thu sep 22 11:35:04 2016 +0530 merge branch 'master' of git_repo_branch commit 0f18c62cbae31b5f6a76d author: user_a date: thu sep 22 11:34:06 2016 +0530 changing name slug commit 56fbcd2e544d97aef2bb author: user_a date: thu sep 22 11:28:38 2016 +0530 changing name slug commit 2eac96cc7c56aa1f3bda29b9257e045c3b923dfe merge: 0caa9d1 f794d6e author: user_a date: wed sep 21 17:08:37 2016 +0530 added a_to_b commit 0caa9d1076ee83d53b0586f2e7cd79f16320ac0e merge: 5df1d6d fb70961 author: user_a date: wed sep 21 15:49:40 2016 +0530 removing conflict commit f794d6ee277f0ba5964dc534c05cfe234761e569 author: user_a date: wed sep 21 15:41:21 2016 +0530 fixing users name commit cc97e8749cccdfee47bb67bbe6470639afbd1d28 author: user_a date: wed sep 21 15:15:53 2016 +0530 raising 404 if user not found commit fb709619d0a9f39c6b2a2c7b5a08c47835970c0f author: user_b date: wed sep 21 12:44:32 2016 +0530 usercount yopwise report commit a332dfe71fd7de74eadcce43337699bb4205e29d author: user_a date: tue sep 20 17:29:35 2016 +0530 code error fix commit 323fa5ed6b2002a664adcfc1ae6b295198258fe2 author: user_a date: tue sep 20 17:22:50 2016 +0530 limiting commit ea94a85e1ad259162d4a883cda08635697012602 author: user_a date: tue sep 20 17:15:17 2016 +0530
you can roll earlier commit, check git log
more details, force commit master branch:
git push origin +<shaofcommit>:master
+
force commit, or can use -f
option.
Comments
Post a Comment