DEV Community

Discussion on: Remove accidentally pushed file from a git repository history in 4 simple steps

Collapse
 
joekaiser profile image
Joe • Edited

To all you devs coming from Google

git push -f be carful with this. the -f stands for force. Be default git will complain if you try to re-write history, but you can force it to go anyway. If you are on a solo project this should be fine, but if you are working on a team make sure no one has pulled the branch and added commits on top of it You won't be doing them any favors.

Don't be afraid to use it. Just make sure you communicate with your team on what is being done.