Rerun failed tests - CircleCI

How to rerun only failed tests in a job and optimize credit usage.