The magnetic compass has been used as a navigation tool since at least the 1st century AD. Although we associate the compass with finding our way to a location, it is not uncommon to want to retrace your steps. The exact opposite to the direct bearing followed to go somewhere new is called the back bearing. This is the bearing you'd take from your destination to your current position.
Subtract 180 from the compass bearing to your destination if the bearing is greater than or equal to 180 degrees. The result is the back bearing.
For example, if the bearing to your destination is 200 degrees, the back bearing is 20 degrees -- 200 - 180 = 20.
Add 180 degrees to the compass bearing to your destination if the bearing is less than 180 degrees. The result is the back bearing.
For example, if the bearing to your destination is 50 degrees, the back bearing is 230 degrees -- 50 + 180 = 230.
Check the accuracy of your calculations by reversing them. For example, if you added 180, now subtract it from the back bearing. If the result is the original bearing, then your calculations were good and the back bearing is correct.
The back bearing is directly opposite the original bearing when looking at the compass housing from above.
Double-check your bearings and take time to get them correct. A compass is only as good as the user, and if you need to use a back bearing, its accuracy is only as good as the original bearing.