Is it possible to undo the changes caused by the following command? If so, how?
git reset --hard HEAD~1
If you're really lucky, like I was, you can go back into your text editor and hit 'undo'.
I know that's not really a proper answer, but it saved me half a day's work so hopefully it'll do the same for someone else!