The Rifleman, Season 5 Episode 9, The Most Amazing Man.
http://www.hulu.com/watch/717011
Sammy Davis Jr. plays Wade Randall who impresses the town with stories of being a gunfighter working for the railroad. Eventually, a friend of a man Randall claims to have killed challenges Randall to a shootout. Randall confides in Lucas McCain he was only a railroad cook. McCain orchestrates with townsfolk a scheme to get Randall out of the mess he created. It ends happily with Randall "retiring" from his made up life.