explanation on git index and ways to undo changes/commits