How to Hard Reset of Moto G XT1540 :
=== At first hold down the Power button for a short while in order to turn off the cell phone.
=== After that press and hold the Volume Up and Volume Down button for about 2-3 seconds.
=== Then select option Recovery by using the Volume Down to navigate, and the Volume Up button to confirm.
=== In the next step hold down the Volume Up button for a few seconds when an Android logo appears on the screen.
=== While still holding the Volume Up, press and release the Power button.Factory Reset
=== After that, press Volume Down to choose "wipe data/factory reset", and then push the Power button to confirm.Remove screen password
=== Next, select "Yes--delete all user data". Use Volume Down button to scroll and Power button to select. After finish the process restart the phone.
Hard reset done. In this way you can give hard reset in your Motorola g xt1540.
See the live video...
According to the video you can do it from home...