I'm new to git and not sure how to approach this.
I want to undo a series of specific commits (relating to a single file) that we decided are not a good solution to a problem but I want to preserve all other commits introduced since.
I don't want to just edit the file to remove that piece of code as I feel reverting here is more explicit and commnicates better the intention.
It goes something like this:
X -> Y -> X -> -X -> Y -> X -> X
Where Y refers to commits relating to that particular feature and X are all commits we want to keep intact, ending up with:
X -> X -> -X -> X -> X
I'm not sure how rebase would work here since I don't want to just include all commits from a certain point onwards.
Would cherry-pick be a better approach?
EDIT: Probably worth mentioning that all those commits are pushed.