for f in $(git diff --name-status --diff-filter='A' HEAD~ "*.kt" | cut -f 2);
do mv -- "$f" "${f%.kt}.java";
done
# Commit the kt to java changes
git add .
git commit -m"kt to java"
# Revert, but stash before committing
git revert --no-commit HEAD
git stash
# Squash the java change into the original commit
git reset --soft HEAD~
git commit --amend --no-edit
# Pop the stashed revert changes and commit
git stash pop
git commit -am"Rename $1 to Kotlin"