Object recoil effect when collides with another object.

Anybody know how to make a object recoil from it's initial position to say 10 pixels back and then 10 pixels forward again when it collides with another object?
Thanks
Thanks

Comments
THis recoil was circular. Th recoil effect i want is for an object to just go back then forth after colliding with antoher object.
Sound simple enough...but i can't get it to work.
HELP!!!