Getting git revision by specific date

Few time ago (years) I explained how to get a specific subversion revision by date (portuguese article):

Today I faced the same situation but using git. Bad news: git doesn’t have –revision tag. Fortunately I found a way to do same thing.
You can use this:

$ git rev-list yourbranch -n 1 --first-parent --before=YYYY-MM-DD


$ git rev-list master -n 1 --first-parent --before=2009-05-20

Now just use the returned hash to checkout that revision:

$ git checkout c06326c73bf90e48a8e1cf8893ad31c575423f50

Also you can execute both command using a single line:

git checkout "`git rev-list rev -n 1 --first-parent --before=YYYY-MM-DD`"