Many people have asked those questions so let me post the information here ..
1.> Release a used stack member-id
(ArubaS2500-48P-US) #clear stacking member-id ?
<id> Member id(0-15)
2.> Renumber stack member-id
(ArubaS2500-48P-US) #set stacking renumber <old-id> <new-id>
3.> Swap stack member-ids
(ArubaS2500-48P-US) #set stacking swap <id1> <id2>
You must keep in mind - those commands will change / clear your stack member IDs but will NOT change your corrsponding configuration. For instance, once you set stacking member id=2 to id=1; all your original interface setting 2/x/x will NOT automatically change to 1/x/x and you need to manually configure them.
To remove all your stacking database and roll back to factory default configuration, you can use the command -
(ArubaS2500-48P-US) #restore factory_default stacking
All configuration and stack settings will be restored to
factory default on this member after reload.
Press 'y' to proceed with reload: [y/n]: y
System will now restart
........
Your device will be automatically reboot after this restore command....