How to recover $f(t)$ from Fourier Transform of its absolute value $\mathcal{F}|f(t)|$?
Matt L.'s comment said it. Once you take the absolute value of the function, you lose its sign. Whatever you do to the result, like taking the Fourier transform, doesn't help. The information is lost.

It is not a part of your question, but the function could have known properties that enable recovery. If it is band-limited, like your cosine, then recovery is possible up to a sign ambiguity $f(t)$ vs. $-f(t)$. In other words, if you know the absolute value of a band-limited function at all times $t \in \mathbb{R}$, and if you know the sign of the function at time $t_1$, then you also know the sign of the function at time $t_2$. For an algorithm, see Gaurav Thakur (2010) "Reconstruction of Bandlimited Functions from Unsigned Samples".