0

Three commits ago I accidentally pushed a modified file to my GitHub repo with some personal data what I don't want to have on github. I removed it and pushed again. The problem is, if someone is browsing the history it's still there. Is it possible to just delete that commit by the commit-ID or something?

WeSt
  • 889
  • 5
  • 14
  • 32
  • If you can remove the file from your branch entirely (e.g. filter branch, `rebase -i` to squash together the commits that add and remove it, etc.) you could then force-push that to GitHub in place of the current branch, and casual browsers wouldn't find it. I don't know if that removes the file from GitHub altogether though, once that commit is no longer referenced. – Rup Dec 22 '18 at 23:29
  • 1
    https://help.github.com/articles/removing-sensitive-data-from-a-repository/ – Phil Ross Dec 22 '18 at 23:55
  • Possible duplicate of [Remove sensitive files and their commits from Git history](https://stackoverflow.com/questions/872565/remove-sensitive-files-and-their-commits-from-git-history) – Phil Ross Dec 22 '18 at 23:57

0 Answers0