I figured this one out.
First, create a couple of global variables. I called them spriteposx and spriteposy.
At the beginning of each GDK loop, set them to equal the current location of your sprite (this code assumes your sprite is designated number 1):
spriteposx = dbSpriteX(1);
spriteposy = dbSpriteY(1);
Now you've stored your sprites' current position before you've tried to move it.
Now you move your sprite. I figure you've gotten this working so I won't post code for it.
Then you check for a collision. This code checks if the sprite has collided with ANY other sprite:
if ((dbSpriteHit ( 1 , 0 )) != 0)
That might not be exactly what you want, since you might not want all sprites to be "solid."
Now, if that returns a value other than 0, we know that my sprite has hit something. So all we need to do is move it back to its previous position before the screen redraws:
if ((dbSpriteHit ( 1 , 0 )) != 0)
{
dbSprite(1,spriteposx,spriteposy,2);
}