Let's say some dev work in his branch and do those commits:
A -> B -> C -> D -> E
I'm the reviewer and I notice that in commit B some files have been changed that shouldn't be.
I'm trying to find the best way to solve that case, I would like to do:
A -> B -> X -> Y -> C -> D -> E
where:
- X is a revert of B
- Y is B without the unneeded changes
I was thinking to do what is following but I know it wouldn't look exactly the same:
- git checkout -b on B
- revert B in X
- do B in a better way in Y
- merge C D E in my branch
- put everything back on the dev branch
Does the above work? Is this the best way to do it or is there a better way?
NOTE: I'm interested to hear any solution involving rewritting the history as well.