Our git branch pipeline is
dev -> test -> uat -> master
where test
, uat
and master
are protected branches.
I have some faulty merges done uptil uat. I would like to revert them. I tried using rebase instead of revert because I was not able to find the n
in HEAD~{n}
uptil which i can revert all my commits and merges.
git revert HEAD~n
So I tried to do rebasse instead. I found the good commit to development till which everything was normal. I used
git rebase -i good_commit_sha
I see a list of all commits (mostly bad) and i drop all of them and pick 2 which were good. But when i see the merge request, I only see the ones I picked (naturally). So i realized that instead of drop i wanted to revert. Is that possible?
I know this is not a good practice but open to suggestions and i do think this is a common scenario.