Searching inverted lines

Hi fellas,
I have a file like this:
A_B
B_D
C_D
D_B
E_F
G_H
B_A
F_E

In other words, I have member1_member2 and member2_member1 in the same file. In the exemple aforementioned I have A_B and B_A, B_D and D_B, E_F and F_E.

So, I would like to know a sript that print the lines B_A, D_B and F_E (the inverted lines) in a new file.

Can you help me?

awk -F_ '{a[$2"_"$1]=1}$0 in a' file

Valente,

Please try with the below command:

 awk -F _ '{print $2"_"$1}' filename >new_filename. 

Thanks bartus11. It worked fine.