I am trying this git thing and I think I messed up. So I have a project called Foo in my computer. I changed directory into that project. Then did, git init, and then git commit into my github. It said it failed to push some ref to the server, so I googled it, and someone said I needed to do a git pull first. Ok, so I did a git pull request from my github server while I was in the Project Foo's directory. Now all files inside my project Foo directory got removed and only the files from the git pull request are stored inside on my Project Foo's directory.
Help, how do I retrieve my files again?
EDIT: here is the terminal history, http://codepad.org/cg9Gi7Ii - the commands from that log around the point where the files disappeared are:
$ ls
Models css js utils
README index.html styles
$ git init
Initialized empty Git repository in /Users/MacBoss/Documents/workspace/BlackboardCanvas/.git/
$ git add .
$ git remote add origin git@github.com:dchhetri/Demo-s.git
$ git push origin master
error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:dchhetri/Demo-s.git'
$ git remote add origin git@github.com:dchhetri/Demo-s.git
fatal: remote origin already exists.
$ git push origin master
error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:dchhetri/Demo-s.git'
$ git pull failed to push some refs to 'git@github.com:dchhetri/Demo-s.git'
fatal: 'failed' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
$ git pull
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From github.com:dchhetri/Demo-s
* [new branch] master -> origin/master
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
If you often merge with the same branch, you may want to
use something like the following in your configuration file:
[branch "master"]
remote = <nickname>
merge = <remote-ref>
[remote "<nickname>"]
url = <url>
fetch = <refspec>
See git-config(1) for details.
$ git pull failed to push some refs to 'git@github.com:dchhetri/Demo-s.git'
fatal: 'failed' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
$ git pull git@github.com:dchhetri/Demo-s.git
From github.com:dchhetri/Demo-s
* branch HEAD -> FETCH_HEAD
$ ls
AStarDemo.jar