I had a compute engine instance, I shut down that instance from command line. Now the thing is when I started it back the IP got changed, which I guess it was because it was ephemeral.
Now I wanted to ask as I am having now new IP. Does my system got changed or just my IP, because if my previous system is changed then I think that all of my data which I had on that compute engine will be still there and if my previous system got assigned to a new person then maybe he can see my data which will be a security breach.
The second question is, is there any way I can get my previous IP assigned to my new instance which I had before.
You're conflating a couple of things here. Networking in GCP is a purely software-defined configuration. As such, the IP of your machine is defined by software and is in no way dependent on things like your instance itself or the disk attached to the instance (where your data actually lives).
To answer your actual questions:
When the machine is restarted, a new ephemeral IP is assigned. Your data is on the disk attached to the machine, and nobody else has access to it.
You have no control over ephemeral IP addresses. If you want to maintain an IP address between restarts, you need to reserve a static IP and assign it to your instance.