Manul rollback on Git

I am trying to implement manual job in the pipeline to rollback a deployment to any version:
What I am looking for is:
1- how can I retrieve at least the last 10 deployment tags from external registry(maven repo) ?
2- On the manual job page, display the list retrieve at step 1 to the user as list to choose from to be the value for a specific defined key.