This is a possible solution. Be sure to understand how does it work and ask any questions that you have.
SELECT Reference,
PARSENAME( r.dotted, 3) + '.' +
MAX( PARSENAME( r.dotted, 2)) OVER (PARTITION BY (SELECT NULL)) + '-' +
PARSENAME( r.dotted, 1)
FROM #SampleData s
CROSS APPLY (SELECT REPLACE( Reference, '-', '.') dotted) r