Civilians attacking me
You can Yield to them by sheathing your weapon. Note that you may still have a bounty for the assault you've just committed that you'll have to deal with. If you aren't in tight with the Thieves Guild and/or have a low Speechcraft skill, this might end up costing you any stolen items you happen to be carrying.
The Imperial power Voice of the Emperor or a calming spell will make them forgive you. Also, you can sheath your weapon (usually R or Square), this indicates you're not here for fighting, and then it's up to the NPCs AI to determine if you are still a threat.