How can a one currency gain against the other if it is pegged aginst it?
Strictly speaking it was not a peg but a cap: the Swiss National Bank said it would sell unlimited Swiss Francs at the rate of 1.2 CHF : 1 EUR.  

You could have bet that the Euro would rise against the Swiss franc by borrowing some Swiss Francs and selling them for Euros, and then taking any profit or loss by unwinding the transaction.  

If for example you had bought Euros with Swiss Francs in May 2012 and sold back in May 2013, this might have been profitable (at least before transaction costs), but if you had held past 15 January 2015 you would have made a loss when the cap was withdrawn.