I done the same you are not alone.
I used a grinder to remove the bung from the pipe, cleaned everthing up slid the flange back to the correct end of pipe and re welded the bung on to the pipe.
I didnt want to tell anyone as I felt a right twat.
I now feel better.