How to recover eMail folders accidentally deleted in Apple Mac
A MacBook Air (Retina, 13-inch, 2018) running 10.15.4 Catalina.
A mail folder containing subfolders was accidentally deleted. This was a Gmail account.
I opened Mail and entered Time Machine. Time Machine would not allow me to jump to another time (clicking any day/time would not jump to that day/time)); I was stuck on 'now' and so I couldn't locate and recover the missing folders this way.
So I quit Mail and manually located ~/Library/Mail in Finder and renamed it to Mail OLD. I then entered Time Machine and restored the entire ~/Library/Mail folder from a backup of earlier in the day.
On running Mail, I saw the accidentally-deleted folders re-appear ... and within a fraction of a second they disappeared again. It was as if GMail synced the wrong way; i.e. instead of uploading the recovered folders to Gmail, it knew the folders on Gmail had been deleted, so it deleted the recovered folders from Apple Mail.
How can I recover the folders from Time Machine without them being automatically deleted again as soon as Mail connects to Gmail?
MacBook Air