4 ms·
I've never seen a scenario that resulted in a developer losing work. You can always retrieve things out of the commit history, even in pathological situations.
by RichardCA 6y ago
I've never seen a scenario that resulted in a developer losing work. You can always retrieve things out of the commit history, even in pathological situations.
- wpietri 6y agoI have lost work. A colleague force-pushed something because he thought he understood Git well enough to get away with it.
- RichardCA 6y agoIf you can find your prior branch head with git reflog, you can assign a new branch name to it and push it. Then go back to your force-pushing colleague and tell him to resolve the merge conflict he created by thinking he was too clever.
- RichardCA 6y agoThe command "git log --all --oneline --graph --reflog" will give you an exhaustive listing of the commit graph in your local repo. Examine the output of that command in detail before declaring your work to be lost.