Worst situation I got into was corrupting the repo to the extent the Bitbucket admins needed to restore it. I forget the details of the workflow that led to it, but the solution was adding git prune to my update script to avoid dangling blobs. That is - instead of running git pull I run a script which pulls and prunes master, then offers to merge if I was working on a branch.
tldr: run git prune once in a while ;)
I know it's not "cool" to say it, but I regularly find people can clean up the mess much faster by redoing the changes on a fresh clone; and learning a cleaner workflow to avoid the problem in future. It often takes hours with two people pairing (the git guru and the git newbie) to unpick the mess, then you have to learn the clean workflow anyway. Basically - remember to do a cost/benefit analysis.
Also never EVER try to start your cleanup efforts on the only existing branch with the work you're trying to save. Push that existing branch somewhere (no matter how broken it is), make a fresh branch and work on the fresh branch. Because it often takes a few goes to get back to a clean state; and you can always delete those backup branches later.