I have a list of commits like this:
Author: xyz
Date: Fri Jul 30 11:48:40 2021 -0700
update tests
commit 76810c2bdf91cd84661fabb06f00f37fc0e6b264
Author: abc
Date: Thu Jul 29 16:38:33 2021 -0700
fix for issue
commit b9a1642c3d778524291c98895425aa0248ed5766
Merge: baeb6428 6b722171
Author: abc
Date: Thu Jul 29 16:36:58 2021 -0700
Merge branch
commit 6b722171718f7aa70236613c544d8ca9f6cdeea9
Author: abc
Date: Thu Jul 29 17:15:02 2021 +0000
Use new type
commit baeb642886c19135c6057fba94849768b5ffc5a3
Author: abc
Date: Wed Jul 28 16:24:10 2021 -0700
old commit
I want to go back to old commit but have one commit 76810c2bdf91cd84661fabb06f00f37fc0e6b264
included. How should I do that?
I tried git revert <hash>
for each one of the commits manually and git revert -m 1 <merge hash>
for merge commits but it is not working as expected. Also, I have a long list of reverts to do and it is a tedious task to do it manually. Is there a simpler way to do this?