I accidentally "unflagged" gmail messages with Mail.app, is there a log somewhere so that I can restore them? I configured Mail.app to access my gmail account, and I noticed some messages were "flagged".

I didn't realise this meant "starred in gmail", so I unflagged them.

While I was doing it I realised that: I was able to re-flag some of them, but I wasn't so quick to save them all.

Is there a log somewhere, so that I can restore the flag/star to all of them?

(using Mail 6.6-1510 on OSX 10.8)
GMail keeps no such logs, and neither does Mail.app

Unfortunately, you're kind of stuck searching for the messages yourself.

If you read a lot of text-based mail, and want a "buffer" of sorts to prevent yourself from doing this in the future, a command line mail client like Alpine can be configured to only synchronize changes like message flags/folders on a configured interval, rather than immediately on the remote side.

Homebrew has a package for it: brew install alpine