A cardioversion is a procedure in which an electrical shock is given to the heart to restore its normal rhythm. Typically, a cardioversion is used to treat atrial fibrillation, atrial flutter, or atrial tachycardia in an elective setting. It can also be used to treat ventricular tachycardia in emergency.