AWS CodePipeline V2 type pipelines now support stage level rollback to help customers to confidently deploy changes to their production environment. When a pipeline execution fails in a stage due to any action(s) failing, customers can quickly get that stage to a known good state by rolling back to a previously successful pipeline execution in that stage. Customers can roll back changes in any stage, whether succeeded or failed, except the Source stage.
Source:: Amazon AWS