So I am working on a project and add a gitignore file to prevent some sensitive data from being included only it fails to work as expected and now I have pushed it. Is there a way to delete that from the remote repository so there is no evidence of it in the history?
You could revert the changes locally
git commit --amend
or
git reset <last-hash>
and then do a
git push -f
but this should only be done
if you:
Tip:
Be very careful, that the repository is in the state you want it to be, before you push -f, because changing history is generally a big no-no for various good reasons
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With