Skip to content

Instantly share code, notes, and snippets.

@egnappahz
egnappahz / timewarp.sh
Created April 7, 2017 08:38
timewarping with git
#!/bin/bash
uncached=$(git diff --cached)
echo $uncached
if [ "$uncached" == "" ]; then
read -p "There is no cachediffrence, you probably already comitted. Do you want to DESTROY the last commit?? Type yes: " yes
if [ "$yes" == "yes" ]; then
git reset --hard HEAD~1
fi
else
read -p "There is a cachediffrence, you probably added the files but didnt commit them. Do you want to DESTROY the uncommited files ?? Type yes: " yes