I pushed a branch based off another branch to GitHub. It has one commit, but shortly after I realized I pushed the wrong version of that branch. I immediately deleted the branch using git push origin --delete <branch_name>
but saw in one of my project tracker programs that the commit I made is still there.
I unfortunately did not think to delete the commit locally and push, then delete the branch locally and push.
Now that the remote branch is deleted, how do I also delete the remote commit?
If I understand correctly, through my research here: Does deleting a branch in git remove it from the history? my commit should be an unreachable/dangling commit but I have not been able to find any answers where I can delete a remote commit.
I have saw that you can use git gc
but is that enough to get rid of the remote commit? Is it possible to keep the local branch and local commit but delete the remote commit?
My end result is that I'd like the remote branch to be deleted (seems good) and the remote commit to be deleted (needs help). Thank you!