Post-operative pain following foot and ankle surgery can come from multiple different sources.  The most immediate source of pain following surgery is the acute pain that develops when nerve tissue is cut during the incision and dissection process required to get to the tissue that needs to be repaired.  This includes skin nerves, and nerves that support deeper tissue.  The pain from this source is often burning or stinging.  While the local anesthetic injected during the surgery can keep this pain limited for about 12 hours after surgery, it eventually wears off.  The use of narcotic pain medications or acetaminophen can help reduce most of this pain afterwards.
 
During the days that follow the surgery, the pain one experiences after surgery shifts sources somewhat.  The body undergoes a natural process in response to the 'injury' of surgery, and this response creates inflammation.  Inflammation is a process in which fluid and healing cells are attracted to the site of injury.  This results in swelling and warmth, and unfortunately pain.  Inflammation is a good thing, but the body tends to 'overdo it' during some injuries and during surgical recovery.  The pain due to inflammation is more of a throbbing, heartbeat nature.  It is worsened when the foot is dangling down, and better when the foot is elevated.  This is due to the fact that gravity automatically forces more fluid to the foot when it is dangling, which increases swelling and inflammation.  Elevation reduces this swelling, and helps limit the inflammation process.  Ice also is an important part of pain control when dealing with inflammation.  Anti-inflammatory medication can be used in some cases to more actively reduce the inflammatory process and improve pain control.
 
Another source of post-operative pain is pain related to more specific aspects of the surgery performed.  For example, when surgery is performed on bones, one can experience some pain due to cutting or moving the bone tissue.  When nerve tissue is operated on, some residual pain from cutting or even handling the nerve can remain following the surgery.  Tendon repair and procedures that lengthen or release soft tissue can also generate pain following surgery.  Finally, some newer techniques in tendon and soft tissue repair involve the actual generation of inflammation to produce an acute healing response in otherwise chronically nonhealing tissue.  This increases post-operative discomfort, but ultimately results in better healing success in the end.