News for hackers. Stuff that matters.
Re:Git Workflow Basics by elmigranto on Wednesday August 17, 2016 @11:39AM (#12305495)
> If you screw up a rebase, the history is re-written…

https://git-scm.com/docs/git-reflog

> …or force-pushed by accident

Well, you could nuke git folder "by accident" as well :) Jokes aside, don't force-push to "other's" branches).

Re:Git Workflow Basics by falsedan on Wednesday August 17, 2016 @06:00PM (#12308814)
If you really feel like you do have to force-push to someone else's branch, please use

    git push --force-with-lease origin/other_branch
so you at least won't trash any commits your collaborator pushed after you last fetched their branch. git will see that your origin/other_branch doesn't match origin's other_branch, and will bail out so you can pull the changes and decide how to incorporate them.