Reset index and tree before pulling

Allows deployment scripts to modify repos without consequences in
the next pull. Closes #1.