Not sure If that's the best option but looks like you can take a bus to Krosno (3.5 h) next a bus from Krosno to Barwinek (0.5 h) which is a village at the border... then you've got around 15 km left, not sure If there's any cross border bus line, at worst you can walk (3h) :))
There is also a version with changing a bus in Miejsce Piastowe instead of Krosno - look at E-podroznik.pl.
I don't know if the buses to Barwinek reach the border. If not, you must walk about 2 km.
There are Slovakian buses from the border in Barwinek/Vysny Komarnik ("Vyšný Komárnik,,št.hr." stop; "št.hr." means the border) to Svidnik - look here:
cp.atlas.sk/vlakbus/spojenie/?f=Vy%c5%a1n%c3%bd+Kom%c3%a1rnik%2c%2c%c5%a1t.hr.&t=Svidn%c3%adk&fc=200003&tc=1&direct=false&byarr=false&submit=true&af=false&lng=S