Nothing will happen, but your next push will not be accepted.
If you do not force a push. It also will not destroy the remote repository, so it is also not so bad.
Things go wrong when you have more people using this repo. Overwriting history can lead to chaos for others who will pull new changes from a remote computer. Especially if they donβt have good git knowledge. There can be different things that can happen in order for a person to drag an overwritten remote branch depending on the state of his local repository.
So, if someone works on function X, and you change the code on which he based his changes, he could at least get completely upset depending on how much of his work you made outdated.
Mateusz
source share