code: func (f *Function) Rollback() error {
  	f.Log.Info("rolling back")
  
  	alias, err := f.currentVersionAlias()
  	if err != nil {
  		return err
  	}
  
  	f.Log.Debugf("current version: %s", *alias.FunctionVersion)
  
  	versions, err := f.versions()
  	if err != nil {
  		return err
  	}
  
  	if len(versions) < 2 {
  		return errors.New("Can't rollback. Only one version deployed.")
  	}
  
  	latest := *versions[len(versions)-1].Version
  	prev := *versions[len(versions)-2].Version
  	rollback := latest
  
  	if *alias.FunctionVersion == latest {
  		rollback = prev
  	}
  
  	f.Log.Infof("rollback to version: %s", rollback)
  
  	_, err = f.Service.UpdateAlias(&lambda.UpdateAliasInput{
  		FunctionName:    &f.FunctionName,
  		Name:            &f.Alias,
  		FunctionVersion: &rollback,
  	})
  
  	if err != nil {
  		return err
  	}
  
  	f.Log.WithField("current version", rollback).Info("function rolled back")
  
  	return nil
  }
docs: // Rollback the function to the previous.