Oh well, poor OT.
On the surface, this looks like a simple scenario. But in version control, for this type of impulses, there are no simple scenarios.
Start with thinking about what you really want:
With that out of the way, the OP asked specifically for the commits to be gone, even though I'd ask back: are you sure? Are you really sure?
And then it gets complicated. What do mean by 'commits be gone'? git rebase -i gives you options and not everything is what you think it is:
A) Dropping a commit will then lead to conflicts with subsequent commits where git tries to apply them. That is the very nature of version control, i.e. the frozen change of state of any number of files. Applying a commit where it doesn't fit will not work in many cases and the more changes, the more conflicts.
B) Did any of the responses mention branches? All your branches will still be there, with all their history. 'git rebase -i' lets you make changes to one branch (e.g. main), but will not affect your branches and branch points. Which is good, as otherwise you couldn't play with the commits that you branched from. But it is bad if you were trying to conceal the commits. They are all still there in the branches!!!
C) Are you working collaboratively with anyone? Are you aware of git push/pull? This is at the heart of git. And what you are suggesting is pulling the rug out from under your buddies feet. They are sure to want to return that favor.
Good luck.