Add a directory to git

git init
git commit -m "commit message"
git remote add origin https://github.com/user_name/project_name.git
git push -u origin master

Reference

Undo the most recent commit message

git commit --amend

or

git commit --amend -m "New message"