If you had sent a resignation two months ago and now they have told you that last day of your work will be oct 16, then that makes a total of 3 months from the day of your notice of resignation.
That means they have prospectively accepted your first resignation.
In effect they are fulfilling the mandate of the contract.
As soon as you receive the mail that oct 16 will be your last day you can reply to that mail be saying that you had retracted from the resignation offered previously, but please bear in mind that accepting the resignation and not accepting the retraction from it is upon the HR team.
Best