Ok, previous weapon as in what? Do you mean switching back to sniper from pistol, for instance? Or switching from shotgun to carbine?
If it is in case the former, try typing this into autoexec.cfg:
If it is in case the former, try typing this into autoexec.cfg:
[SELECT ALL] Code:
bind Q [primary]