#!/bin/sh
set -eu

usage () {
    cat <<'EOF'
usage: git trash

Options:
-h    Show this help
EOF
}

while getopts h flag; do
    case "$flag" in
        h) usage; exit 0;;
    esac
done
shift $(($OPTIND - 1))

if git-is-clean; then
    echo "Nothing to trash."
    exit 0
fi

git add --all
git commit -m 'Trash'
git reset --hard HEAD^
