C.C didn't loose her memories, she sealed her Code probably to prevent Charles from stealing it from her when Lelouch promised her to make her smile.
Episode 16 - United Federation of Nations Resolution Number One
C.C: Um... what should I be doing now?
Lelouch: Let's see now. Sing me a song while hopping on one foot and wearing your clothes inside out.
C.C: Yes. Right away, master.
Lelouch: What? No, wait! I was kidding!
C.C: I'm sorry. Please don't beat me hard again.
Lelouch: Her mind is completely reverted. She's now only the slave girl before the power of Geass came.
Episode 20 - Emperor Dismissed
Anya: It's been ages since we were face to face like this. It's me! C.C., don't tell me that you've actually...
C.C: I'm so sorry!
Anya: What are you doing? Closing yourself up in here again like this. C.C.? C.C.!
C.C: Who are you?
Anya: It's me. See?
C.C: It's you. So you've chased me all the way in here now. Are you that worried about Lelouch, Marianne?
Marianne: Oh, c'mon. Do you really think I'm such an ideal mother that that's all I think about?
C.C: Then why did you come here for me?
Marianne: Because so much has changed. I need to know if you're still on my side.
C.C: Huh?
Marianne: C.C., why did you seal off your own Code? Just when you have what you wanted. Charles was ready to grant your greatest wish, the wish to die. But you stopped him.
C.C: Even I don't know why I did it. Actually I'm a little shocked, but I did.
Marianne: Then you have to find the answer in the real world. I've made up my mind and that's all there is to it.
C.C's memories appear to be tied to her Geass so when she sealed her Code she reverted back to before she got Geass from that Num who later forced her to take the Code.
as for the "temple" (which remember Suzaku was corrected when he called it a temple by Charles who said it's a weapon) they never destroyed it. the Sword of Akasha is the one place but there are different gateways to it. it appears that any Geass Location that appeared when Ragnarok was activated has a Twilight Gate than links back to the Sword of Akasha with the Geass Order having a Twilight Gate within their facility
How the sword got damaged was that C.C released the Shinkiro and with that Lelouch attacked the place with it.