Trim trailing newline from `nth_deploy_commit` ref

Reverting deploys would fail at the `git reset` step because the
ref fetched from `nth_deploy_commit` had a trailing newline.