I do not know gitX, but it looks a lot like you created a commit with no parents by accident. If that’s the case, you need to follow these steps:
- Copy your
.git
repository in case something goes wrong - Note the SHA of your current commit on master (
SHA1
) - Use a combination of
git reflog master
and maybegitk --walk-reflogs
orgit log --walk-reflogs
to find the SHA of your previous commit (SHA2
). - Run
git checkout -B master **SHA2**
to get back to that commit - Run
git checkout **SHA1** -- .
to get your changes back in the working directory - You are now back where you were before your mistake. So commit your changes and you are done.