Anna Kendrick has thanked her hacker for helping her reconnect with old friends.

The Pitch Perfect star returned to Twitter for the first time on Tuesday (Dec 15) since her account was targeted at over the weekend and a string of offensive messages were posted, and joked she’d found the silver lining in the security breach.

She posted: “Well, the fun thing about getting my Twitter briefly hacked is that people I hadn’t heard from in years reached out to let me know.

“So, I guess thank you to my hacker for a little anxiety, and for getting me back in touch with my high school friend James. Cheers.”

The 35-year-old star also shared a genuine message of thanks to late-night Showtime host The Kid Mero for helping her restore her account — which has had all of the fake tweets removed — back to normal.

She wrote: “Also shout out to the FIRST person to get me in touch with someone from Twitter before anyone else managed to do anything helpful @THEKIDMERO. “What a f****** legend.”

​​​​​​​Meanwhile, Anna previously admitted she thinks modern dating is “terrifying”.

The star of HBO’s Love Life — who is in a relationship with cinematographer Ben Richardson — is relieved not to be single as she’d hate to have to rely on apps like Tinder to find love.

She previously said “It seems completely terrifying. I think Tinder is an app designed by Satan to destroy us all, I don’t think I’d be able to do it.”

But if she did have to resort to the app, she would rather someone “ghosted” her — simply stopped contact — than tell her face-to-face that they weren’t interested.

She said: “I’m totally pro-ghosting. I know that people say, ‘Well I’d rather someone just tell me they didn’t like me rather than completely disappear and never contact me again’ but I’m actually not adult enough to deal with that – I’d rather figure it out and save a little face, actually.”

Anna is aware that her career has caused some of her relationships to “wilt” because she is simply too busy to give people her full attention.

She added: “When you get this busy, you end up with the people in your life who are willing to put up with it. Anybody else ends up falling away.

“I do feel guilty for basically letting all my relationships wilt – but luckily everybody who matters is understanding.”