(I believe this question is technically distinct from Can a local variable's memory be accessed outside its scope? because it is C instead of C++.)
I know that in C
You cannot safely look at what that pointer points to, once you're outside the block, exactly as you suspect.
The "memory location" that was used for the value of X, of course, lives on, so something is likely to be there. But accessing it has no guaranteed safe result; you're likely to see garbage, and in extreme cases it might even crash the program. (And for some amount of time, you might find that the original value of X is still present! That's a red herring; it doesn't make it OK to use.)