git filter and accidentally pushing commit history to github #22850
-
Any help, hi guys i want to delete a file and used git filter-branch so i accidently pushed all the commit history to github now how do i fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi @zukelwa20, This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information. As you’ll notice, your Topic is now in the How to use Git and GitHub board. No action is needed on your part; you can continue the conversation as normal here. Let me know if you have any other questions or if I can help with anything else. Cheers! |
Beta Was this translation helpful? Give feedback.
-
I’m not sure what exactly the problem is from your description. You say that you wanted to delete a file and used Let us know. |
Beta Was this translation helpful? Give feedback.
-
I pushed the wrong history how can I reverse it? |
Beta Was this translation helpful? Give feedback.
-
There’s no easy way to “reverse” a push. Git is a version control system and for that reason errs on the side of keeping data rather than forgetting or losing it. You can, however, change the local history of a branch to whatever you want and use I hope that helps! |
Beta Was this translation helpful? Give feedback.
There’s no easy way to “reverse” a push. Git is a version control system and for that reason errs on the side of keeping data rather than forgetting or losing it. You can, however, change the local history of a branch to whatever you want and use
git push --force
to force the remote GitHub repository to accept the new history of that branch.I hope that helps!