Git fatal: Reference has invalid format: 'refs/heads/master'
http://stackoverflow.com/questions/12773488/git-fatal-reference-has-invalid-format-refs-heads-master
The fix for me was opening up .git/refs/packed_refs and deleting lines that contained the text "conflicted".