I have accidentially scrapped a good weapon that I use as my primary gun. Is there any way to undo this and get the gun back?
Unfortunately not. Once you scrap something, it is gone forever. The best advice i can give to prevent this happening again is to mark the weapons you like as favourites. When you try to scrape a favourite weapon, the game will warn you. At least when you are clearing out all the junk weapons in your inventory, you can rush through it and know you will not accidentially delete good stuff because you will get the warning if you click the wrong thing.