How do I delete a commit from github history?

Asked

Viewed 1,288 times

6

I would like to delete a commit made on github but WITHOUT deleting the changes, which is why I discovered that in one of my files the code contained personal information and by altering it that information could still be seen in the commit history, I mean, I want to delete exactly the commit from the history. How can I do that?

Things I tried to remove the commit from and also the changes made: git reset -hard HEAD^ (Go back to previous commits and remove changes made after this commit)

  • Lucas, I’ve seen ways to erase all history, only one I’ve never seen... erase everything, attend to you?

  • git goes to commits and deletes at least gitLab like this

  • look can work, as it does?

1 answer

2

  • 2

    It worked perfectly thank you very much/

  • 1

    Very good, exactly what I needed!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.