The commands that you are seeing are meant to create an empty branch gh-pages.
It is not meant to be a new directory, but a new branch, with no link to your master and other branches and add the github pages related content in there. It must have been done as a first step, but you might have done it after adding files, which might be fine. Read the instructions on the gh-pages wiki. It explains why the above commands were needed and also warns that you will lose the files, like you did - http://pages.github.com/
You can also use git checkout --orphan gh-pages as an alternative.
See my answer here: How do I create a commit without a parent in Git?How do I create a commit without a parent in Git?