What can I do to get out of a command block teleporting loop? [duplicate]

Run:

/gamerule commandblocksenabled false

Then fix the loop, and run:

/gamerule commandblocksenabled true

to turn command blocks back on.