you can restart from step2 (where it failed), and design your step2 to skip some processing during restart, depending on current application state, or job parameters passed when invoking restart.
There is a way to tell restart to restart from a specific step, if your previous job execution was stopped. If you look at job.xml.xsd schema, the stop element has a restart attribute that tells which step to restart from. Your can design your step2 to stop upon certain error condition (instead of failing) so you can provide a restart value.
<stop on="match on this exit status" exit-status="set the new exit status" restart="stepB"/>