By subscribing to the "bumper" topic, the data is available to that node. (Assuming you're using C++, as you didn't mention - the theory is the same, but obviously the syntax will differ). Using the example publish/subscribe code on the ROS website (link).
#include "ros/ros.h"
#include "std_msgs/String.h"
//Callback for bumper data
// this callback happens
void bumperCallback(const std_msgs::String::ConstPtr& msg)
{
//print received data for debugging
ROS_INFO("I heard: [%s]", msg->data.c_str());
//If the callback data contains "hit" - change to integer, float or whatever type your message is
if(msg->data.c_str() == "hit")
move_backwards(); // Call function to move the robot backwards
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "listener");
ros::NodeHandle n;
ros::Subscriber sub = n.subscribe("bumper", 1000, bumperCallback);
ros::spin();
return 0;
}