$ git reflog
# Switch to the correct branch (if necessary?)
$ git checkout master
# Hard reset head to the lost commit
git reset --hard 1dd3a55
SourceTree comes with its own embedded Git and Mercurial. These are not available outside on regular command lines by default, but seems you can make them so by adding the following two paths to your
Here is a very simple way to add automatic deployment via GitHub. This assumes
Log on to your web host and do the initial pull.
Put the following script in a file named for example
deploy.cgi in your website root.
Add execute rights to the script.
You should now be able to visit
http://<your-website>/deploy.cgi in your browser and see output like this:
https://github.com/<you>/<website>/settings/hooks, click on WebHook URLs and enter the full URL to your script,
With this set up you should be able to make a change at your dev machine, commit it and push it to GitHub. The script should then be executed shortly after and your website should be updated automatically. Pretty cool 🙂
This is of course ultra simple, and if this is a critical site you should probably add some security of some sort. A simple version could be to use a cryptic name like a guid for the script and of course not have this script checked in at GitHub. You might also perhaps want to only pull from a certain branch or things like that, but for a small simple site this works pretty well as long as you remember to only push to GitHub when you have a working set of commits 😉