#!/bin/sh WEB_DIR=/path/to/example.com # Change to your site folder # remove any untracked files and directories git --work-tree=${WEB_DIR} clean -fd # force checkout of the latest deploy git --work-tree=${WEB_DIR} checkout --force