When I do an interactive rebase, e.g.
git rebase -i HEAD~3
the rebase interactive editor (vim in my case) opens to let me edit the commits
If you exit the editor with an error code, the rebase will be aborted.
To exit with an error code on vim, do
:cq
See here and vimdoc here.