Studyon Minte9.com
Git




Repository backup



Copy .git directory in your backup drive, and that all!


To recover the files user "git reset --hard commit_id" :


$ cd /d/backup/brdmarkets/

$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       deleted:    config/autoload.php
#       deleted:    config/config.php
#       deleted:    config/constants.php
#       deleted:    config/database.php
#       deleted:    config/hooks.php
 ....

$ git log
commit 9d6528976b371b9460f7f7e18692dd045098c124
...

$ git reset --hard 9d6528976b371b9460f7f7e18692dd045098c124
HEAD is now at 9d65289 m


Now, all the files are in your backup directory.


http://stackoverflow.com/questions/3639115/reverting-to-a-specific-commit-based-on-commit-id-with-git