Bash script to amend older commits with staged changes