The correct option is
C had finished
In the given sentence, the word 'went' indicates that the tense of the sentence is past tense. Also, the fact that Peter went to work indicates that his previous action had been completed.
Option A is incorrect. 'finishing' indicates that Peter's action is ongoing and not complete. Also, using 'finishing' will make the sentence grammatically incorrect as it is not accompanied by an auxiliary and is an incomplete verb.
Option B is incorrect. 'was finishing' is in the past tense but, 'finishing' indicates that Peter's activity is ongoing and not complete. Since the sentence indicates that Peter's activity was completed, option B is incorrect.
Option C is correct. 'had finished' is in the past tense. Also, 'finished' indicates that the activity had been completed. Thus, it meets all the required conditions and is the correct answer.
Option D is incorrect. 'has finished' indicates that the activity has been completed but, 'has' indicates that it is in the present tense. Thus, using it will make the tense of the sentence inconsistent.