I made a git repo (only a master branch) with one remote and one local. There are no other users who have cloned it but the remote path can be cloned by a few users.
My local clone is at commit #17 and I have pushed up til commit #12 to the remote. I’ve come to realize that every commit after #6 should not be shared and the remote needs to (for now) remain at #6.
I don’t want to lose all the commits 1-17 and the history but in order to reset the remote my understanding is I have to first reset local to #6 and push -f that. Is it possible for me to reset the remote to #6 while locally remaining ahead at 17 so that if someone clones the remote they can’t see the vulnerable commits?
My idea is that I would need to clone my local to a different local first so that the second local keeps all 17 commits and history before executing the reset followed by the push -f. Is this how one would approach this situation?