Files
minecraft-character-vrc/repo-discard.sh
2026-03-02 13:29:22 +05:00

20 lines
388 B
Bash
Executable File

#!/bin/sh -e
repository="$(dirname "$(readlink -f "$0")")/."
cd "${repository}"
git rev-parse --is-inside-work-tree >/dev/null
echo "The following files were changed and will be reverted:"
git diff --name-only HEAD
printf "\nExecute [Y,N]?"; read -r yn
if [ "$yn" = "${yn#[Yy]}" ]; then
echo "Aborting restore..."
else
git restore "${repository}"
echo "Done."
fi
exit 0