#!/bin/sh
set -e 

if [ -z "$1" ]
then
        >&2 echo "Branch name must be specified"
        exit 1
fi

git branch "$1"
git switch -
git reset --hard "@{u}"
