Yes, I did that bone-headed memory card thing: I erased one of my camera's SD cards before I transferred the photos to my Mac. After performing the requisite forehead slapping, I went in search of software that would get my pictures back.
Notice that I didn't panic. When a camera or computer typically erases a memory card, the images aren't actually deleted. The blocks on the memory are marked as recordable, so new data writes over the old. In this case, I was confident I could get the photos, since I hadn't shot any new images since erasing the card. Some cameras can optionally perform a low-level format of a card, which overwrites all the card's data. Camera manufacturers don't make the distinction easier, since some models, such as my Nikon D90, refer to erasing the card as "formatting," but the photos are still recoverable.
If you're reading this article because you just accidentally erased a card and searched the Web for a solution, take a breath and know that it's highly likely you'll get your photos back. Remove the card from the camera so you don't shoot any more pictures that could overwrite your "erased" ones, and read on.
Data Rescue II -- First, I checked to see if I already owned something that could do the job. Prosoft Engineering's  is designed to search through hard disks and recover their data. Using the program's Assistant mode, I performed a Thorough Scan, which looked at every block on the card. Scanning the 8 GB card took about 15 minutes on my 2.33 GHz MacBook Pro.
The downside to using Data Rescue for this purpose is that it assumes you're searching for file names, not images. I could see that the file T4352x2868-00387.nef could be recovered, but I didn't know what image the file contained. The scan revealed every file it could, which included photos I'd already imported into Aperture.
At the time, I wasn't choosy (so I may have panicked a little when I saw that my photos were gone), so I was happy to recover all 5 GB worth of them. I would have to sort through them later, but at least the images were safe.
Data Rescue II costs $99 and requires Mac OS X 10.2.4 or later. A demo version is available as a 14.2 MB download.
Klix -- I imagine someone at Prosoft Engineering must have erased a media card at some point and run into the same issues I did, because the company's JoeSoft division offers , a $29.95 utility specifically designed to grab erased media.
The Klix interface is simple: one window where you select your media card and start scanning, and an Image Recovery window where you preview the images Klix locates.
The software first copies the entire contents of a card to your hard disk for backup (an option that can be turned off in the program's preferences). Depending on the card's capacity, expect to wait several minutes and watch a progress bar creep across the screen. This temporary duplicate is deleted when you quit the program.
After copying, Klix scans the card for media (more waiting, about 20 minutes for my 8 GB card), and then displays the images in the Image Recovery window. I could select all images or just the ones I was missing, then click the Recover button to copy them to a folder of my choosing on my hard disk.
Having thumbnails of the card's images, which Data Rescue doesn't offer, makes a huge difference. I was able to choose just the missing shots and recover them. That said, the thumbnails are small and are just one size; you can't zoom in to see more detail. And, for some reason, the Image Recovery window can be expanded in height, but the width is limited to five pictures across.
I want to also mention an annoyance. When the application first launches, it asks if you'd like to check for updates - a completely reasonable feature. You can click Yes or No to perform the check, but there's also a box marked "Check for updates on launch." Clicking Yes to check for the update opens another modal dialog that notes you have the latest version; you must click OK to get rid of it. The problem is that it's not an automatic option: the same dialog appears every time you open the program. Just let me authorize a quick online check at startup once, make it happen in the background, and bother me only if there's an actual update.
Those quibbles aside, the end result is that I was able to recover just the photos I wanted (about 1 GB worth) instead of everything on the card thanks to Klix's image previews.
Klix costs $29.95. A free demo version can scan and locate images on a card, but is limited to recovering one file of any size. The software is a 2 MB download and requires Mac OS X 10.2.4 or later.
Photo Recovery for Mac 3.5 -- Another utility, AppleXsoft's , offers more granularity for locating erased images. While Klix locates all media files, Photo Recovery for Mac can search for just the file types you know (or suspect) are on the card. Choosing Nikon from the Search pop-up menu selected JPG Image, TIFF Image, and NEF Image (the latter being Nikon's raw file format). In fact, Photo Recovery doesn't limit itself to just photos and videos; there are options to locate Excel and PowerPoint files, Zip archives, audio formats, and more.
What also impressed me, at first, was the capability to start previewing photos while Photo Recovery performed its scan, displaying a selected file in a large preview area that scales with the application's window. This feature let me start looking for the batch of missing pics right away.
However, that turned out to be something of a trick: I wasn't actually previewing and selecting photos, because Photo Recovery was performing the recovery during the scan, copying all the files it found to my hard disk. That did allow me to open a file and edit it if I wanted, but I didn't need to wait for the time Photo Recovery took to retrieve those I didn't want.
I should point out something important, but not thoroughly tested. I discovered that none of my applications - including Adobe Photoshop CS4 and Nikon Capture NX 2 - could open the NEF images Photo Recovery created. The AppleXsoft Web site notes that the "saving option" is disabled in the evaluation version, so I'm assuming that Photo Recovery may be deliberately mangling file data in the demo version, which is what I was using.
The free demo is available as a 4.8 MB download. Photo Recovery for Mac costs $49.99 and requires Mac OS X 10.3 or later.
Image Rescue 3 -- I remembered that a Lexar memory card I bought at one point included a free version of Lexar Image Rescue, but the software had long ago been sacrificed to the evil mound that is the cluttered top of my desk; also, I think it was distributed on a , which can't be used with any of my slot-loading Macs. The company's  came highly recommended from some of my contacts, however, and I can see why.
Image Rescue 3 boasts the friendliest interface of the lot, with step-by-step sections that explain what is happening and what will happen next. Like Photo Recovery, Image Rescue can narrow the list of file types to search, with camera presets to search for compatible formats. It also allowed me to preview the images before copying them to my hard disk.
Image Rescue 3 costs $28.99, and Lexar does not offer a demo version. If you've purchased a Lexar card, look for a URL in the card's documentation that points to a free download on the Lexar Web site.
Putting a Price on Memory -- Each application I've mentioned here also includes features for erasing memory cards, including low-level formats that can help remove drive corruption issues. Image Rescue 3 can also test a card to help identify potential problems, and it can burn images to a CD or DVD.
I'd like to think that I've learned my lesson and this will be the last time I use any of these utilities. That's why I initially thought the programs were priced too high; why pay $30 or $50 for an application you're going to use infrequently? But the answer came off the card in the form of the photos, digital captures of moments that can't be repeated. And honestly, I can't rule out future bone-headed memory card moments in my future.