Fixing an unbootable computer after a failed grub installation can be a bit tricky. Here’s what I ended up doing. More here
First of all, boot the machine up and get access to the root partition:
Get a Debian installation CD for the same architecture (i.e. don’t use an i386 CD if your root partition is amd64). The distro version doesn’t matter too much: a lenny CD will boot squeeze/sid just fine.
Boot the install CD and select Rescue mode under Advanced options.