Rescue inaccessible VM without SSH in Google Cloud Platform

I made a mistake in the script of a service in my linux VM in Google Cloud Platform. Now the VM does not boot properly, and no ssh server starts.

Is there any other way to rescue this instance and its files, like, somehow edit files without starting the instance?

Maybe somehow download a snapshot and use some tool to edit?


You can delete the instance without deleting the boot disk. Attach and mount the disk to any other running VM make the modification and than create an instance with this disk. You can refer to this link for steps.

Make sure to take the snapshot of the disk before deleting the instance, which will make sure you have a disk backup in case if anything goes wrong