Replace all occurrences of a number followed by a hyphen followed by another number with the second number followed by a hyphen followed by the first number in the file file.txt.
sed -i 's/\([0-9]\+\)-\([0-9]\+\)/\2-\1/g' file.txt