She felt as if her heart were flipping over inside her chest.

Literal

She [topic-は] chest [genitive-の] inside [at-で] heart [subject-が] flips-over feeling was.

ひっくり返る is a vivid intransitive verb — 'to flip over, be turned upside down' (transitive: ひっくり返す). Here it captures the lurch of the heart at a sudden shock or surprise. ~思いだ ('felt that..., had the feeling that...') is a stock construction for reporting a vivid subjective sensation — ~が~する思い captures internal experiences with a literary flair. Note that 心臓 (the physical heart organ) appears here, not 心 (the metaphorical 'heart' of feeling) — Japanese keeps these surprisingly distinct.