Here is a basic way to do it:
Every Tick:
+ Sprite: set X to: Sprite.X + 1
Sprite: is overlapping Wall:
+ Sprite: set X to: Sprite.X - 1
If the motion is more complex another way to do it would be to save the sprite's x,y position in variables before moving the sprite. Then if it collides with a wall you can undo the motion by setting the sprite's position to the values in the variables.