3 ms·
Oh shit I accidentally force pushed my local master branch to origin.
by margaretdouglas 6y ago
Oh shit I accidentally force pushed my local master branch to origin.
- deleted 6y ago[deleted]
- Arnavion 6y agoWell, if you're already force-pushed it once, you might as well force-push the right commit (from reflog, if necessary) back to it again.
- margaretdouglas 6y agoOnly works if you've recently fetched origin, otherwise it'll be a challenge sorting out what the previous HEAD was.
- sio8ohPi 6y ago--force-with-lease is almost always the flag you ought to use instead. "--force-with-lease alone, without specifying the details, will protect all remote refs that are going to be updated by requiring their current value to be the same as the remote-tracking branch we have for them."