YOu beware , dont kill smith Andre of Astora. I ancidentally killed him with one hit from my greatsword..so beware. He is very very need latter in game. ..arg this game is so stupid, wish there is way to revive him.
If you have attacked an NPC by mistake and have NOT killed him yet. You can go to the priest in the Undead Burg bell tower (where you fought the two gargoyles) and atone for your sins (costs souls depending on your soul level). This will reset the NPCs so you can talk to them normally again.