I always have the same question regarding this advice: how are you supposed to handle data corruption?
When a buggy new version creates lasting problems in the persistent data, reverting to the last known good version may not fix the problem as the correct code now has to deal with incorrect data, which lead to a different, possibly incorrect behavior compared to before the buggy deployment.
Reverting the data itself is often not possible as you usually can’t say to your customers « woops, we deleted all of your bank transactions / incoming emails for the last two weeks because of a rollback on our side ».
So in my experience you still have to roll forward in a lot of cases, to fix both the code and data together.
How do you guys handle that in practice?