I pushed an unwanted commit, and now I want to remove it. For its removal, I have used :
git rebase -p --onto SHA^ SHA
So now it looks like I have removed the unwanted pushed commit, and it doesn't show itself in git log.
( But I can see it in git reflog
).
However, I can still reach the commit by its SHA
and see the files in URL.
Even though they are not seen in /commits/all.
Also, I can see that in my recent activities, I have removed the commit with its SHA.
But again, I can reach to it by URL : /commits/all/SHA_of_removed_commit
How can I remove this commit and all its contents, so that it would be impossible to see it even in URL?
EDIT:
I have tried : git reset --hard SHA_that_I_am_happy_with
but it did not work. I can still connect to unwanted one in URL.
I have tried to run git gc --aggressive
but it also did not stop me seeing the unwanted commit files in its URL.
Also, i can still see it when I say :
git show unwanted_pushed_commit_SHA
ANOTHER EDIT :
I have run :
git fsck --no-reflogs
git reflog expire --expire-unreachable=now --all
git gc --prune=now
After all these, git show
unwanted_commit_SHA
says :
fatal:ambiguous argument 'unwanted_commit_SHA' : unknown revision or path not in the working tree.
But I can still see it via its URL..
How can I finally get a 404 page when I type URL of repository/commits/unwanted_commit_SHA?