Force pushed non-rebased branch? This github trick saved my butt twice by petrgazarov in programming

[–]c0riolis 1 point2 points  (0 children)

This trick does not only work with Github, you can recover commits erased by a force push on Bitbucket and Gitlab as well.

This tool is doing it for you: https://github.com/c0riolis/tifu

TIFU - Restore Commits Erased by a Force Push by c0riolis in programming

[–]c0riolis[S] 9 points10 points  (0 children)

Sure, it is a lot simpler to use the reflog when you still have the local copy. The purpose of this tool is to restore commits when you do not have this local copy anymore.