If your real life issue is exactly like your example, you would seem to get your requirement trivially. If your example does not represent your real life challenge, more finesse is likely required.
(x1 <- factor(c(3,2,1,2,3,1,2), ordered = TRUE, levels = c("3", "2", "1")))
(rev_num_x1 <- as.integer(x1))
In this example we have data 3,2,1,2,3,1,2 because you have set the factor as ordinal the integer representation of the factors is already numbers that map directly to the old 3/2/1 are themselves 1/2/3 so now as you go through the vector ; where you had a 3 before you have a 1 , where you had a 2 you keep 2's and where you had 1s you have 3.