Restore temporary variable on exit.