I am trying to undo a really old commit that has already been pushed to the remote.
I looked around and thought that git rebase was probably the best solution.
so I ran the code:
git rebase -i <commit-id>
then edited:
pick <commit-id> <commit-title>
drop <commit-id> <commit-title> <- the commit I want to delete
pick <commit-id> <commit-title>
Then tried applying this with :wq. This however triggered a LOT of merge conflicts (the commit is about half a year old).
The reason I want to undo the commit is because I accidentally added a file with credentials on it that I should not share with other collaborators.
So the only thing I want to undo is the "creation" of the file on the remote.
Is git rebase the best approach?
if so is there a way not to trigger all the merge conflicts (merge them just like before)?
I would rather not accidentally merge a conflict in the wrong way.
Also the commit I am trying to delete should not cause any conflicts with future commits. I tried running git rebase without dropping the commit but the merge conflicts still popped up.