Britney Spears on Erratic Era: What Was I Thinking?

Even Britney Spears wonders what happened to her in the last couple of years, as she breaks her silence on a dark period that found her in rehab, shaving her head and gunning for the paparazzi with a golf umbrella.

"I sit there and I look back and I'm like, 'I'm a smart person.' Like, 'What the hell was I thinking?"' Spears said in an interview to air on MTV on Nov. 30, two days before the release of her new album.

Click here for photos.

"Sometimes it can get kind of lonely because you don't open the gate up that much, you know what I mean?" she said in footage from the documentary "Britney: For the Record." "You're guarded; you have to be that way. So I'm kind of stuck in this place and it's like, how do you deal? And you just cope and that's what I do. I just cope with it — everyday."

The 90-minute special, executive-produced by her manager Larry Rudolph, features behind-the-scenes footage of the singer talking about her life over the past two years.

"I've been through a lot ... and there's a lot that people don't know," she said.

Last month, the singer appeared to be on the road to career recovery, winning three MTV Video Music Awards including one for video of the year for her song "Piece of Me." Late last month, her new single "Womanizer" was released.

She tells MTV News that she wanted to do the documentary "because I started to feel like I wasn't being seen in the light that I wanted to be seen in. This is an opportunity to set the record straight and talk about what I've been through and where I'm headed," she said in a statement to MTV News.

During the two years covered by the documentary, Spears has gotten divorced, been through a custody battle, gone to rehab, had very public meltdowns and had one memorably bad performance at the MTV Video Music Awards.

Now on the comeback trail, Spears is releasing her sixth album, "Circus," on Dec. 2, her 27th birthday.

And she says despite the lows, she's still having fun doing what she does.

"It never stopped being fun for me," she said. "I really always liked what I did."

Click here to watch more at MTV.

The Associated Press contributed to this report.