I bought a 10-year G-Sec 8 months ago. Can I sell it before maturity and what happens to my return?

Bought a 10-year G-Sec last year through RBI Retail Direct. Locked in a decent yield at the time. Now I need the money sooner than expected. Can G-Secs actually be sold before maturity? And if yields have moved since I bought, what does that do to what I actually receive?

and if yields have gone up since I bought, does that mean I get less than I paid?

so you could actually lose money on a government bond if you sell before maturity. people don’t realise that