#!/bin/sh
if git is-clean; then
    echo "Nothing to do." >&2
    exit 0
fi

git rebase --abort 2>/dev/null || true
git reset --hard HEAD
git clean -df
