I've done something like following:
(1) clone a remote git repository to local host
local# git clone http://www.foo.com foo
(2) add another project on a ssh host(bar) as the second remote repository
local# git remote add bar ssh://bar/home/project
local# git fetch bar
(3) done something stupid on the ssh host(bar):
bar# rm -rf /home/project
Could you please tell me how can I recover project on the ssh host(bar) from my local copy, so other developer on the ssh host can continue their work, and I can run 'git fetch bar' to get their commit, just like I didn't do anything wrong to their ssh host, i.e. undo all I did to host bar. thanks a lot.
UPDATE:
bar# mkdir -p /home/project && cd /home/project && git init --bare
local# git branch remote show bar
local# git push bar bar/master:refs/heads/master
local# git push bar bar/branch1:refs/heads/branch1
local# git push bar bar/branch2:refs/heads/branch2