I suffered from RSI, on my wrists and forearms for many years.... and generally now I rarely get it... a lot is due to behaviour and rapid response to when I feel an onset.
1. Use Anti-inflamatories, Ibuprofen or others. As soon as you feel a twitch, pop 400-600mg and then keep 400mg 3 times a day, for at least 2 days even if it stops hurting keep taking them the first day, keep taking them at least for a day or two. If you had it for 3 or 4 days it is far far harder to get back to normal.
2. Change your posture. and behaviour.... unless it is forced on you changing behaviour is hard.... so I recommend you get a good Microsoft keyboard with the split type or, get yourself wrist guards (for skating etc) which will lift your fingers up above the keyboard. Often of the problem is due to your hands and wrists at not aligned flat and your tendons are under unneccesary tension... The wrist guards, will feel very funny to start with, but you will get use to it.... Try different type so wrist guards. but I recommend those that lift your writs of the tables as they have big plastic bent beneath. These..
https://simtek.lt/wp-content/uploads...-Blue-Rear.jpg
What ever you do, don't have surgery or any of that kind of stuff... unless you have tried variations on what I suggest above for a few months.