I'm a git novice, but I've been able to create a bare remote repository on a shared drive so it can be shared with co-workers. I created a test.txt
file, added it to the local repository, committed it to the local repository, and then pushed it into the remote repository. Then I delete the test.txt
file in my local repository.
At this point, I'd like to copy the test.txt
file from the remote repository into the local repository. If I delete my local repository and clone the remote repository, the test.txt
file shows up just fine. But, I'm not sure how to recreate the test.txt
file in the local repository without completely deleting the repository and starting over.
Based upon what I've read, I think I should be able to run git pull origin master
, but when I do that, the test.txt
file does not reappear in my local repository.
I'm still wrapping my head around git, so I may be thinking about this incorrectly. I guess I'm thinking that I should be able to just "reset" the local repo to the remote repo and start over without cloning it again.
Update:
I just tried this and it seemed to work: git reset --hard origin/master
. Not sure if that's the right way to do it or exactly what --hard origin/master
means.